Skip to content

Category Archives: Algorithms

Given non-negative integers K, M, and an array arr[] with N elements find the Mth element of the array after K left rotations. Examples: Input:… Read More
Given a binary tree, the task is to find the length of the longest path which forms an Arithmetic progression. The path can start and… Read More
Given a square matrix M[][] of size N x N, the task is to find the maximums & minimums of each of the rows and… Read More
Given an array arr[] containing N non-negative integers, the task is to find the maximum AND value among all the subsets having length K.  Examples: … Read More
Given an arr[ ] of size N, containing positive, negative integers and one zero. The task is to rearrange the array in such a way… Read More
Given an array arr[] of N integers, the task is to replace each element of Array with their rank according to Rightmost-Set Bit (RSB) in… Read More
Given an array arr[] of N non-negative integers and an integer P (1 ≤ P ≤ 30), which denotes the upper limit of any number… Read More
Given the series 2, 8, 18, 32, 50…, find the Nth term of the series. Examples: Input: N = 1Output: 2 Input: N = 3Output:… Read More
Given a positive integer N, the task is to find the Nth term of the series 0, 2, 6, 12, 20…till N terms Examples: Input:… Read More
Given a positive integer N, the task is to find the Nth term of the series 0, 6, 24, 60, 120…till N terms Examples: Input:… Read More
Given a positive integer N, the task is to find the sum of the first N terms of the series  2, 5, 8, 11, 14..… Read More
Given a positive integer N, the task is to find the Nth term of the series 5, 10, 20, 40….till N terms Examples: Input: N… Read More
Given a positive integer N, the task is to find the Nth term of the series  3, 10, 21, 36, 55…till N terms Examples: Input:… Read More
Given a natural number N, the task is to find the Nth term of the series  0, 9, 24, 45, . . . .till N… Read More
Given an integer N, the task is to find the Nth term of the series  2,  8,  18,  32,  50, ….till N terms Examples: Input:… Read More

Start Your Coding Journey Now!