Given a string str of length N, the task is to find the minimum number of substrings required to be removed to make all the remaining characters of the string same....
Given an array arr[], the task is to find the length of the longest subsequence of the array arr[] such that all adjacent elements in the subsequence are different....
Given a string S of length N, consisting of lower case alphabets, and queries Q[][] of the form [L, R], the task is to count the number of characters appearing an odd number of times in the range [L, R]....
Given an array arr[] of size N, the task is to check if for all distinct triplets of indices i, j, k, [ 0 ≤ i < j < k ≤ N-1 ] the sum arr[i]+arr[j]+arr[k] is present in the array....
Given an array arr[] of size N (1 ? N ? 105), the task is to find the number of ways to select triplet i, j, and k such that i < j < k and the product arr[i] * arr[j] * arr[k] is positive. Note: Each triplet can consist of at most one negative element....
Given a string str, the task is to count non-empty substrings with equal number of ‘a’, ‘b’, ‘c’, and ‘d’....
Given two arrays arr1[] of size M and arr2[] of size N, the task is to find the sum of bitwise AND of each element of arr1[] with the elements of the array arr2[]....
Given a binary array arr[], the task is to find the longest subarray of non-empty cells after the removal of at most 1 empty cell....
Given a ternary string S consisting of only three characters, the task is to find the count of ordered triplets (i, j, k) such that S[i], S[j] and S[k] are distinct and j – i != k – j....
Given a string S of size N consisting of characters a, b, and c only, the task is to find the number of substrings of the given string S such that the frequency of character a is greater than the frequency of character c....
Given an array arr[] of N integers, the task is to find the minimum deletions required such that frequency of arr[i] is exactly arr[i] in the array for all possible values of i.Examples:...
Given an array of strings arr[][] of size N and a string S, the task is to find the number of strings from the array having all its characters appearing in the string S....