Length of longest subsequence having absolute difference of all pairs divisible by K
Given an array, arr[] of size N and an integer K, the task is to find the length of the longest subsequence from the given… Read More »
Given an array, arr[] of size N and an integer K, the task is to find the length of the longest subsequence from the given… Read More »
Given an array arr[] consisting of N positive integers, the task is to count the maximum number of pairs (arr[i], arr[j]) such that arr[i] +… Read More »
Given an array arr[] consisting of N integers, the task is to count the total number of pairs of array elements from the given array… Read More »
Given an array A[] consisting of N distinct integers and another array B[] consisting of M integers, the task is to find the minimum number… Read More »
Given an array arr[] consisting of N integers, the task is to find the maximum sum of the squares of array elements possible from the… Read More »
Given an array arr[] of size N, the task is to count possible pairs of array elements (arr[i], arr[j]) such that (arr[i] + arr[j]) *… Read More »
Given an array arr[] of size N, the task is for every array indices is to find the smallest missing non-negative integer upto that index… Read More »
Given an array arr[] of size N, the task is to count all possible even length subarrays having bitwise XOR of subarray elements equal to… Read More »
Given an array arr[] of size N, the task is to count possible pairs of array elements (arr[i], arr[j]) such that (arr[i] + arr[j]) *… Read More »
Given an array arr[] consisting of N integers and an integer X, the task is to split the array into two subsequences such that the… Read More »
Given an array arr[] consisting of N integers, the following three operations can be performed on any element one at a time: Add one to… Read More »
Given an array arr[] consisting of N positive integers, the task is to generate all distinct subsequences of the array. Examples: Input: arr[] = {1,… Read More »
Given two arrays arr[] and min[] consisting of N integers and an integer K. For each index i, arr[i] can be reduced to at most… Read More »
Given an array a[] of size N, which contains only non-negative elements, the task is to find any integer K for which there are exactly… Read More »
Given an array, arr[] of size N and an integer K, the task is to partition the array into the minimum number of subsets such… Read More »