Unique Paths Leetcode Solution

The problem Unique Paths Leetcode Solution states that you are given two integers representing the size of a grid. Using the size of the grid, the length, and breadth of the grid. We need to find the number of unique paths from the top left corner of the grid to …

Read more

Number of Good Pairs Leetcode Solution

Problem Statement In this problem an array of integers is given and we have to find out the count of total number of good pairs (a[i], a[j]) where a[i]=a[j]. Example nums = [1,2,3,1,1,3] 4 Explanation:   There are 4 good pairs at indices (0,3), (0,4), (3,4), (2,5) . [1,1,1,1] 6 Explanation:  …

Read more

How Many Numbers Are Smaller Than the Current Number Leetcode Solution

Problem Statement In this problem, we are given an array. For each element of this array, we have to find out the number of elements smaller than that element. i.e. for each i (0<=i<arr.length) we have to find out count of elements less than the number arr[i]. For that we …

Read more

Sum of All Odd Length Subarrays Leetcode Solution

Problem Statement In this problem an array of positive integers is given. We have to calculate and return a single integer, the sum of all possible odd length subarrays of the given array. A subarray is a contiguous subsequence of the array. Example arr = [1,4,2,5,3] 58 Explanation: The odd-length subarrays of …

Read more

Translate »