Array Rotation |
Given an integer array A of size N and an integer B, you have to return the same array after rotating it B times towards the right. |
View |
Count Of Elements |
Given an array A of N integers. Count the number of elements that have at least 1 elements greater than itself. |
View |
Good Pair |
Given an array A and an integer B. A pair(i, j) in the array is a good pair if i != j and (A[i] + A[j] == B). Check if any good pair exist or not. |
View |
Linear Search - Multiple Occurences |
Given an array A and an integer B, find the number of occurrences of B in A. |
View |
Max Min of an Array |
Given an array A of size N. You need to find the sum of Maximum and Minimum element in the given array. |
View |
Reverse in a range |
Given an array A of N integers and also given two integers B and C. Reverse the elements of the array A within the given inclusive range [B, C]. |
View |
Equilibrium index of an array |
Your task is to find the equilibrium index of the given array |
View |
Even numbers in a range |
You are given an array A of length N and Q queries given by the 2D array B of size Q×2. |
View |
In-place Prefix Sum |
Given an array A of N integers. Construct prefix sum of the array in the given array itself. |
View |
Product array puzzle |
Given an array of integers A, find and return the product array of the same size where the ith element of the product array will be equal to the product of all the elements divided by the ith element of the array. |
View |
Range Sum Query |
You are given an integer array A of length N. You are also given a 2D integer array B with dimensions M x 2, where each row denotes a [L, R] query. For each query, you have to find the sum of all elements from L to R indices in A (0 - indexed). |
View |
Closest MinMax |
Given an array A, find the size of the smallest subarray such that it contains at least one occurrence of the maximum value of the array and at least one occurrence of the minimum value of the array. |
View |
Leaders in an array |
Given an integer array A containing N distinct integers, you have to find all the leaders in array A. An element is a leader if it is strictly greater than all the elements to its right side. |
View |
Special Subsequences "AG" |
You have given a string A having Uppercase English letters. You have to find how many times subsequence "AG" is there in the given string. |
View |
Generate all subarrays |
You are given an array A of N integers. Return a 2D array consisting of all the subarrays of the array |
View |
Maximum Subarray Easy |
You are given an integer array C of size A. Now you need to find a subarray (contiguous elements) so that the sum of contiguous elements is maximum. But the sum must not exceed B. |
View |
Subarray in given range |
Given an array A of length N, return the subarray from B to C. |
View |
Sum of All Subarrays |
You are given an integer array A of length N. You have to find the sum of all subarray sums of A. |
View |
Anti Diagonals |
Give a N * N square matrix A, return an array of its anti-diagonals. Look at the example for more details. |
View |
Column Sum |
You are given a 2D integer matrix A, return a 1D integer array containing column-wise sums of original matrix. |
View |
Main Diagonal Sum |
You are given a N X N integer matrix. You have to find the sum of all the main diagonal elements of A. Main diagonal of a matrix A is a collection of elements A[i, j] such that i = j. |
View |
Matrix Transpose |
Given a 2D integer array A, return the transpose of A. |
View |
Minor Diagonal Sum |
You are given a N X N integer matrix. You have to find the sum of all the minor diagonal elements of A. |
View |
Rotate Matrix |
You are given a n x n 2D matrix A representing an image. |
View |
Row Sum |
Find Row Sum of given A array. |
View |
Minimum Swaps |
Given an array of integers A and an integer B, find and return the minimum number of swaps required to bring all the numbers less than or equal to B together. |
View |
Spiral Order Matrix II |
Given an integer A, generate a square matrix filled with elements from 1 to A2 in spiral order and return the generated square matrix. |
View |
Subarray with given sum and length |
Given an array A of length N. Also given are integers B and C. Return 1 if there exists a subarray with length B having sum C and 0 otherwise |
View |
Sum of even indices |
You are given an array A of length N and Q queries given by the 2D array B of size Q*2. Each query consists of two integers B[i][0] and B[i][1]. |
View |