Given an array arr of N integers, the task is to calculate the length of longest sequence of consecutive integers that can be formed from… Read More

# Category Archives: Algorithms

Given an integer K, the task is to find two consecutive perfect squares whose difference is K. If there don’t exist any such pairs of… Read More

Given an array arr[] consisting of N integers, the task is to find the number of triplets whose indices and elements at that indices are… Read More

Given an array arr[] of N distinct binary strings each having N characters, the task is to find any binary string having N characters such… Read More

Given an array arr[] consisting of N positive integers and a positive integer M, the task is to find the smallest possible integer K such… Read More

Given an array of pairs arr[][] of the form {X, Y} such that each arr[i] represents the time X at which the candidate with candidate… Read More

Given N integer coordinates where X[i] denotes the x-coordinate and Y[i] denotes the y-coordinate of the ith coordinate, the task is to find the sum… Read More

Given a tree consisting of N nodes an array edges[][3] of size N – 1 such that for each {X, Y, W} in edges[] there… Read More

If in ANOVA test we come to a conclusion that we have to reject our null hypothesis(H0) and then we know that some treatment or… Read More

Given an array arr of N integers, and an array of keys, such that key for each element in arr is equal to its index… Read More

Given two positive integers X and K, the task is to find the K-th smallest positive integer Y, such that X + Y = X… Read More

Given an array arr of length N with values 1 and 2 indicating type 1 and type 2 elements and two players, player1 and player2.… Read More

Given a Binary Tree consisting of N nodes having no values in it and an integer X, that represents the value of the root node,… Read More

Given the root of a Complete Binary Tree consisting of N nodes, the task is to find the total number of nodes in the given… Read More

Given a range [L, R], the task is to find the count of numbers in the range [L, R] that can be expressed as a… Read More