## Find All Numbers Disappeared in an Array Leetcode Solution

Problem Statement In this problem, we are given an array of integers. It contains elements ranging from 1 to N, where N = size of the array. However, there are some elements that have disappeared and some duplicates are present in their place. Our goal is to return an array …

## Majority Element II Leetcode Solution

In this problem, we are given an array of integers. The goal is to find all the elements which occur more than ⌊N / 3⌋ time in the array where N = size of the array and ⌊ ⌋ is the floor operator. We need to return an array of …

## Contains Duplicate II Leetcode Solution

Problem Statement In this problem we are given an array of integers and we have to check if there exists any duplicate element which are at a distance of at least k to each other. i.e. the difference between the indices of those two same element should be less than …

## Relative Sort Array Leetcode Solution

In this problem, we are given two arrays of positive integers. All elements of the second array are distinct and are present in the first array. However, the first array can contain duplicate elements or elements that are not in the second array. We need to sort the first array …

## Find Words That Can Be Formed by Characters Leetcode Solution

Problem statement In the problem ” Find Words That Can Be Formed by Characters” we are given an array of strings that consists of lower case English alphabets (words) and a string that consists of a set of characters (chars). Our task is to check for each string in the array …

## Summary Ranges Leetcode Solution

Problem Statement In Summary Ranges problem a sorted unique integer array is given. We have to make smallest sorted list of ranges that cover all numbers in array exactly once i.e. each element of array is covered by exactly one of the ranges. Each range [a,b] in the list should …

## Find Numbers with Even Number of Digits Leetcode Solution

In this problem, we are given an array of positive integers. We need to find the count of numbers with an even number of digits. Example Array = {123 , 34 , 3434 , 121 , 100} 2 Explanation: Only 34 and 3434 are integers with an even number of …

## Number of Equivalent Domino Pairs Leetcode Solution

Problem statement In the problem ” Number of Equivalent Domino Pairs,”  we are given a list of dominoes where each domino consists of two values like dominoes[i]=[a,b]. Two dominoes, dominoes[i] =[a,b] and dominoes[j]=[c,d]  are equivalent if (a==c and b==d) or (a==d and c==d). Our task is to find out the …

## Check If It Is a Straight Line Leetcode Solution

In this problem, we are given an array of points. This represents a list of x-coordinates and y-coordinates of some points that lie on an X-Y 2-D plane. We need to check if these points form a straight line. Note that there will be at least 2 points in the …

## Pascal’s Triangle II Leetcode Solution

Problem Statement In this problem we have been given Row index(i) of the Pascal Triangle. We have to create a linear array containing the values of the ith row and return it. Row index starts from 0. We know that Pascal’s triangle is a triangle where each number is the …