Skip to content

Category Archives: Algorithms

Given three strings, ‘X‘, ‘Y‘ and ‘Z‘, the task is to count the number of subsequences of ‘X‘ which is lexicographically greater than or equal… Read More
Given an array A[] and positive integer K, the task is to count the total number of pairs in the array whose product is divisible… Read More
Given an array arr[] containing N points of 2D plane and a reference point P0 (a0 , b0), the task is to sort these points… Read More
Given two integers N and H, the task is to find the count of distinct Binary Search Trees consisting of N nodes where the maximum… Read More
Given an integer K, the task is to find the maximum possible number having digit sum K and no 0 and same digits consecutively. Examples:… Read More
Given an array A[] of N integers. Consider an integer num such that num occurs in the array A[] and all the positions of num,… Read More
Given an array arr[] of size N and a number K, the task is to find the sum of the first K natural numbers that… Read More
Given an integer N (which is always a power of 2) denoting the length of an array which contains integers in range [0, N-1] exactly… Read More
Given an integer N, the task is to construct a permutation from 1 to N where no adjacent elements have difference as 1. If there… Read More
Given two integers X and Y, the task is to find the minimum number of operations required to make X equal to Y by performing… Read More
Given two positive integers L and R, the task is to find the count of numbers in the range [L, R] which are not divisible… Read More
Given an array arr[] of size N, the task is to minimize the number of steps to make all the array elements equal by performing… Read More
Given an array A[] of length N, the task is to find the minimum possible value of bitwise OR of the elements after removing at… Read More
Given an array arr[] of size N, the task is to find the maximum possible sum of a subset of the array such that no… Read More
Given a string S and an integer N, the task is to calculate the number of strings of length N consisting of only lowercase characters… Read More

Start Your Coding Journey Now!