Given a binary string S of size N, the task is to find the length of the longest non-increasing subsequence in the given string S.… Read More

# Category Archives: Algorithms

Given a matrix mat][][] of size M x N which represents the topographic map of a region, and 0 denotes land and 1 denotes elevation,… Read More

Given string S consisting of lowercase and uppercase letters, the task is to find the number of substrings having the equal number of lowercase and… Read More

Given an array arr[] consisting of N integers, the task is to count the number of distinct pairs (arr[i], arr[j]) in the array such that… Read More

Given two N-digit positive integers X and Y, the task is to find the minimum absolute difference between both the integers possible by rearranging the… Read More

Given a positive integer N, the task is to print all the distinct even and odd values of prefix Bitwise XORs of first N natural… Read More

Given an array consisting of first N odd numbers, the task is to find the minimum number of operations required to make all the array… Read More

Given an N-sided polygon, the task is to find the ratio of the area of the Nth to (N + 1)th N-sided regular nested polygons… Read More

Given two arrays arr1[] and arr2[] consisting of N and M integers respectively, the task is to print the Bitwise XOR of Bitwise AND of… Read More

Given an array arr[] consisting of N integers, the task is to find the lexicographically largest permutation of the given array possible by exactly one… Read More

Given a 2D array plates[][] of size N, which each row representing the length and width of a N rectangular plates, the task is to… Read More

Given a positive integer N, the task is to count the number of integers from the range [1, N] having exactly 5 divisors. Examples: Input:… Read More

Given a string S consisting of N lowercase alphabets, the task is to check if it is possible to make all characters of the string… Read More