Skip to content

Category Archives: Algorithms

Given an array arr[] of size N having only positive elements, the task is to find the number of primes less than the number formed… Read More
Given a binary string S of length N, consisting of 0’s and 1’s, the task is to find the minimum sum of the array of… Read More
Given an integer N, the task is to find the value after performing the following N operation when i is 1 initially: Find the value… Read More
Given two strings str1 and str2, the task is to check if the two strings are isomorphic to each other. Two strings str1 and str2… Read More
Given an array arr[] of integers N, the task is to find the GCD of all numbers for which it’s value is equal to its… Read More
Given arr[] of 5 integers denoting the values of X+Y, X−Y, X*Y, X%Y and ⌊X/Y⌋  in sorted order for two non-zero integers X and Y,… Read More
Given a binary tree, the task is to print all the nodes of the binary tree in Pre-order, Post-order, and In-order in one iteration. Examples:… Read More
Given a string S of length N, the task is to remove the longest prefix of the string which has at least one duplicate substring… Read More
Given an integer array arr[] and a positive integer K, the task is to count all distinct pairs with differences equal to K. Examples: Input:… Read More
Given a number K which is the maximum possible number of diagonals in any polygon, the task is to find the number of sides of… Read More
Given an array consisting of N positive integers, and Q queries where each query is one of the following types: 1 l r – Requires… Read More
Given a binary array arr[] of size N and an integer K, the task is to check whether the binary array can be turned into… Read More
Given an array A[] of size N, the task is to find the minimum element present in all subarrays for all sizes from 1 to… Read More
Given an array arr[] of size N and an integer K, the task is to minimize the value of the maximum element of the array… Read More
Given two integers N and M, the task is to find the Mth lexicographically smallest binary string (have only characters 1 and 0) of length… Read More

Start Your Coding Journey Now!