Given an array arr[] of size N, the task is to calculate the maximum sum that can be obtained by dividing the array into several… Read More

# Category Archives: Competitive Programming

Given a binary string S of size N and a number K, the task is to find if all the ‘0’s can be changed into… Read More

Given an array arr[] consisting of N integers the task is to find the minimum number of elements that should be removed, such that for… Read More

Given an array arr[] of size N, and an array Q[] consisting of M queries of type {L, R}, the task is to print the… Read More

Given three integers L, R, and K, the task is to find the minimum Bitwise XOR of at most K integers between [L, R]. Examples:… Read More

Given three numbers N, K, and M, the task is to find the maximum value that can be assigned to the Kth index if positive… Read More

Given a positive integer K and two arrays A[] and B[] of size N and M respectively, each containing elements in the range [1, K].… Read More

Given an array arr[] of size N, the task is to find the lexicographically smallest permutation of first 2*N natural numbers such that every ith… Read More

Given a 2D array, arr[][] denoting a list of coordinates of N vertices on 2D space that is already sorted by x-coordinates and y-coordinates, the… Read More

Given 2 array of strings X and Y, the task is to find the number of superstrings in X. A string s is said to… Read More

Given a binary string of size N, the task is to count the number of alternating substrings that are present in the string S. Examples: … Read More

Given an array arr[] of size 3 denoting the number of balls of type 1, 2, and 3 respectively, the task is to find the… Read More

Though C++ is the dominating language in the competitive programming universe, there is a fair share of users who still continue to use Java. If… Read More

Given a string path consisting of characters ‘N’, ‘S’, ‘E’ and ‘W’ denoting 1 unit movement in North, South, East, and West directions respectively, the… Read More

Given an array arr[] consisting of N distinct integers, the task is to print for each array element, all the greater elements present on its… Read More