## Find the number of p-sided squares in a grid with K blacks painted

Given a grid of size H*W with all cells initially white. Given N pairs (i, j) in an array, for each pair, paint cell (i,… Read More »

- Optimal Strategy for a Game | Set 2
- Sliding Window Maximum (Maximum of all subarrays of size k) using stack in O(n) time
- Count pairs in array whose sum is divisible by K
- Find k closest numbers in an unsorted array
- Building Heap from Array
- Amazon Internship Interview Experience
- Check if given Preorder, Inorder and Postorder traversals are of same tree | Set 2
- Maximum sum such that no two elements are adjacent | Set 2
- k-th missing element in an unsorted array
- Longest subsequence such that adjacent elements have at least one common digit
- Sort an array without changing position of negative numbers
- Create linked list from a given array
- Maximum element in a sorted and rotated array
- Given two arrays count all pairs whose sum is an odd number
- Find maximum xor of k elements in an array
- Partition an array of non-negative integers into two subsets such that average of both the subsets is equal
- Find the longest string that can be made up of other strings from the array
- Maximum absolute difference in an array
- Remove minimum elements from either side such that 2*min becomes more than max | Set 2
- Find minimum difference between any two elements | Set 2
- Program to check if an Array is Palindrome or not
- Kth smallest element in a subarray
- Count the triplets such that A[i] < B[j] < C[k]
- Introduction to Data Structures | 10 most commonly used Data Structures
- Number of subsets with zero sum
- Count of integers of length N and value less than K such that they contain digits only from the given set
- Maximum sum combination from two arrays
- Find m-th smallest value in k sorted arrays
- Minimum cost to reach end of array array when a maximum jump of K index is allowed
- Find the minimum number of operations required to make all array elements equal

Given a grid of size H*W with all cells initially white. Given N pairs (i, j) in an array, for each pair, paint cell (i,… Read More »

Given an array arr[] of N integers and Q queries. Each query can be represented by two integers L and R. The task is to… Read More »

Given an array arr[] of length N. The task is to find the length of the longest subarray in which elements greater than a given… Read More »

Given a tree with N distinct nodes from the range [1, n] and two integers x and val. The task is to find the maximum… Read More »

Given an array A[] and positive integer K, the task is to count the total number of pairs in the array whose sum is divisible… Read More »

Given an array A[] of size N with entries as integers, some of the entries are -1. The task is to replace -1’s with numbers… Read More »

Given 21 Matchsticks and 2 users, A and B (computer and user respectively). Users can pick matchsticks not more than four at a time. The… Read More »

Given an array arr[] of size 10 where arr[i] represents the frequency of the digit i. The task is to find the smallest positive number… Read More »

Given an array arr[] of size N. The task is to find the sum of the digits of all array elements which contains even number… Read More »

Given an array of N elements where each element i, the absolute difference between total elements to the right and left of it are given.… Read More »

Let represent the ordered pair of the second maximum and the maximum element of an array respectively. We need to find all such unique pairs… Read More »

Given an array, find the number of subsequences whose sum is even and the number of subsequences whose sum is odd. Example : Input: arr[]… Read More »

Given an unsorted array of integers, print the array after removing the duplicate elements from it. We need to print distinct array elements according to… Read More »

Given an array arr of size N and a number K. The task is to find the minimum elements to be replaced in the array… Read More »

Given an array arr[] of size N. The task is to find smaller elements on the right side and greater elements on the left side… Read More »