## Count of triplets that satisfy the given equation

Given an array arr[] of N non-negative integers. The task is to count the number of triplets (i, j, k) where 0 ≤ 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
- Building Heap from Array
- Find k closest numbers in an unsorted array
- Amazon Internship Interview Experience
- Check if given Preorder, Inorder and Postorder traversals are of same tree | Set 2
- Create linked list from a given array
- Maximum sum such that no two elements are adjacent | Set 2
- Maximum Sum Subsequence of length k
- Sort an array without changing position of negative numbers
- Maximum absolute difference in an 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
- Kth smallest element in a subarray
- Count the triplets such that A[i] < B[j] < C[k]
- Find the longest string that can be made up of other strings from the array
- Find minimum difference between any two elements | Set 2
- Partition an array of non-negative integers into two subsets such that average of both the subsets is equal
- Introduction to Data Structures | 10 most commonly used Data Structures
- Count of integers of length N and value less than K such that they contain digits only from the given set
- Number of subsets with zero sum
- Split the given array into K sub-arrays such that maximum sum of all sub arrays is minimum
- Maximum sum combination from two arrays
- Greatest contiguous sub-array of size K
- Remove duplicate elements in an Array using STL in C++
- Find the smallest positive number missing from an unsorted array | Set 3
- 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
- Pair with largest sum which is less than K in the array

Given an array arr[] of N non-negative integers. The task is to count the number of triplets (i, j, k) where 0 ≤ i <… Read More »

Given an array arr[] of integers, the task is to find the count of permutation of the array such that the permutation is in increasing… Read More »

Pre-requisite: Majority Element, Majority Element | Set-2 (Hashing) Given an array of size N, find the majority element. The majority element is the element that… Read More »

In programming it is quite usual for a Java programmer to face time limit exceeded or TLE if they do not use Arrays.sort() function carefully.… Read More »

Given an array arr in Java, the task is to print the contents of this array. Loop method: The first thing that comes to mind… Read More »

Given an array of 0s and 1s, If any particular index i has value 1 then it is a safe index and if the value… Read More »

Given an array of distinct integer A, the task is to count the number of possible permutations of the given array A[] such that the… Read More »

Given a number N, the task is to reduce it to a single-digit number by repeatedly subtracting the adjacent digits. That is, in the first… Read More »

Given an array arr[] of N non-negative integers. The task is to find the right most non zero digit in the product of array elements.… Read More »

Given N pairs of numbers. The task is to count ways to choose exactly one number from each pair such that the sum of those… Read More »

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 »