Skip to content

Category Archives: Algorithms

Geek has developed an effective vaccine for the Coronavirus and he wants each of the N houses in Geek Land to have access to it.… Read More
Given a number N, the task is to represent N as sum of maximum number of unique positive integers. Examples:  Input: N = 12Output: 1+… Read More
It is often considered that writing a publisher in Robot Operating Systems (ROS) is far easier than working with the subscriber. On most accounts, this… Read More
Given an integer N,  the task is to find the total number of ways a sequence can be formed consisting of distinct consecutive odd integers… Read More
Given an integer N, the task is to generate a permutation of elements in the range [1, N] in such order that the length of… Read More
Given three integers X, Y and Z denoting the frequencies of three different characters ‘0‘, ‘1‘, and ‘2’ respectively. the task is to find the… Read More
Given a Grid of size NxM, and two integers X and Y, the task is to count the minimum number of rows between the row… Read More
The push–relabel algorithm (alternatively, pre flow–push algorithm) is an algorithm for computing maximum flows in a flow network. Push-relabel algorithms work in a more localized… Read More
Given an N*M (N + M ≤ 40)matrix mat[][], each cell has some value ranging from 0 to 1018 and an integer  K. Find the… Read More
Given an array arr[] of length N. The task is to find the length of the longest subsequence of the array such that the absolute… Read More
Given a string str of length N, and an integer K, the task is to form K different strings by choosing characters from the given… Read More
Given three integers N, K and X. The task is to construct an array of size N where MEX of every K sized subarray is… Read More
Given an integer N count the number of values of X such that  X⊕N > N, where  ⊕ denotes bitwise  XOR operation Examples: Input: N =… Read More
Given an array arr[] containing N integers where 0 ≤ A[ i ] ≤ N,  the task is to divide the array into two equal… Read More
Given a sentence S and a string B having distinct characters, find a string by joining the words of S according to given conditions:- Choose… Read More

Start Your Coding Journey Now!