Given a string S consisting of lower case English letters and an integer K, the task is to find, for each distinct character in S,… Read More

# Category Archives: Searching

Given an array of strings of lowercase English alphabets. The task is for each letter [a-z] to find the count of strings having these letters.Examples:… Read More

Given a String, and You have to validate whether the given String is Valid Roman Numeral or not. If it is valid print True else… Read More

Given an array arr[] of N integers and an integer K, the task is to sort these integers according to their distance from given integer… Read More

Given two positive integers dividend and divisor, our task is to find quotient and remainder. The use of division or mod operator is not allowed.… Read More

Given an array A[] and an integer X. Find the number of unordered triplets (i, j, k) such that A[i] < A[j] < A[k] and… Read More

Given a string str and an integer K, the task is to check if it is possible to make the string K palindromes using all… Read More

Given the integers a, b, N, the task is to find the largest number x such that is an N-digit number of base b. Examples:… Read More

Given a Matrix arr[][] of size M x N having positive integers and a number K, the task is to find the size of the… Read More

Given a stream of numbers as arr, the task is to find the rank of each element in the stream in descending order when they… Read More

Given an array arr containing N elements, find the length of the longest subsequence such that it is a valid permutation of a particular length.… Read More

Given an array arr[] of size N, the task is to find the number of distinct pairs in the array whose sum is > 0.… Read More

Given a string str of length N. The task is to find out the lexicographically smallest string when at most only one swap is allowed.… Read More