1588. Sum of All Odd Length Subarrays | Day-6 | DSA-DaysProblem Statement Given an array of positive integers arr, return the sum of all possible odd-length subarrays of arr. A subarray is a contiguous subsequence of the array. Input: arr = [1,4,2,5,3] Output: 58 Explanation Here we need to find the sum ...Aug 18, 2023 · 5 min readitsrohit.hashnode.dev
1365. 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...Aug 16, 2023 · 5 min readitsrohit.hashnode.dev
1480. 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:...Aug 12, 2023 · 3 min readitsrohit.hashnode.dev
1672. Richest Customer Wealth | Day 3 | Arrays | LeetcodeProblem Statement You are given an m x n integer grid accounts where accounts[i][j] is the amount of money the i<sup>th</sup> customer has in the j<sup>th</sup> bank. Return the wealth that the richest customer has. A cu...Aug 10, 2023 · 2 min readitsrohit.hashnode.dev
1512. 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),...Aug 8, 2023 · 4 min readitsrohit.hashnode.dev