# Category Archives: Algorithms

Given a positive integer N. In one operation subtract N with its highest divisor other than N and 1. The task is to find minimum… Read More
Given an array arr[] consisting of integers. The task is to find minimum deletions required to remove the initial minimum and maximum element from arr[].NOTE:… Read More
Given two positive integers A and B. The task is to minimize operations required to reduce A and B to 1. There are two types… Read More
Given two sorted arrays A[] and B[] consisting of N and M integers respectively, the task is to find the Kth smallest number in the… Read More
Given an array arr[] consisting of N integers, the task is to find the maximum count of integers that are binary searchable in the given… Read More
Given a positive integer N, the task is to find the maximum set of numbers from the first N natural numbers whose Bitwise AND is… Read More
Number System is a method of representing numbers on the number line with the help of a set of symbols and rules. These symbols range… Read More
Given an array arr[] of size N and an integer X, the task is to find the length of the longest subsequence such that the… Read More
Given three integers A, B, and K. The task is to check whether A and B can be reduced to zero by decrementing x and… Read More
Given two arrays arr1[] and arr2[] of size N and N – 1 respectively. Each value in arr2[] is obtained by adding a hidden value… Read More
Given an array arr containing N unique integers. The task is to calculate the minimum number of deques required to make the array sorted. Example: … Read More
Given string str that contains only digits, the task is to return an expression by inserting the ‘+’ or ‘*’ operator between every two digits… Read More
Given a matrix mat[][] of dimensions N*M and an array target[] of M integers, the task is to check whether any row of the matrix… Read More
Given numeric string S of size N and a positive integer K, the task is to find the minimum number of adjacent swaps required in… Read More
Given a ternary string S of length N containing only ‘0’, ‘1’ and ‘2’ characters and Q queries containing a range of indices [L, R],… Read More