Rohit Guptavilgad.hashnode.dev·Aug 16, 20231365. How Many Numbers Are Smaller Than the Current Number | Day-5 | DSA-DaysProblem Statement Given the array nums, for each nums[i] find out how many numbers in the array are smaller than it. That is, for each nums[i] you have to count the number of valid j's such that j != i and nums[j] < nums[i]. Return the answer in an a...Discuss·115 readsDSA-DaysDSA
Rohit Guptavilgad.hashnode.dev·Aug 12, 20231480. Running Sum of 1d Array | Day - 4 | DSA-Days | Arrays | LeetcodeProblem Statement Given an array nums. We define a running sum of an array as runningSum[i] = sum(nums[0]…nums[i]). Return the running sum of nums. Example 1: Input: nums = [1,2,3,4] Output: [1,3,6,10] Explanation: Running sum is obtained as follows:...Discuss·1 like·50 readsDSA-DaysDSA
Rohit Guptavilgad.hashnode.dev·Aug 8, 20231512. Number of Good Pairs | Day -2 | DSA-Days | Arrays | LeetcodeProblem Statement Given an array of integers nums, return the number of good pairs.A pair (i, j) is called good if nums[i] == nums[j] and i < j. Example 1: Input: nums = [1,2,3,1,1,3] Output: 4 Explanation: There are 4 good pairs (0,3), (0,4), (3,4),...Discuss·105 readsDSA-DaysDSA
Rohit Guptavilgad.hashnode.dev·Aug 6, 20231470. Shuffle The Array | Day -1 | DSA-Days | Arrays | LeetcodeProblem Statement Given the array nums consisting of 2n elements in the form [x1,x2,...,xn,y1,y2,...,yn]. Return the array in the form [x1,y1,x2,y2,...,xn,yn]. Example 1: Input: nums = [2,5,1,3,4,7], n = 3 Output: [2,3,5,4,1,7] Explanation: Since x1...Discuss·4 likes·206 readsDSA-DaysDSA