Skip to content

Category Archives: Competitive Programming

Given a binary string s, the task is to calculate the number of such substrings where the count of 1‘s is strictly greater than the… Read More
When we talk about Competitive Programming, we can’t ignore the significance of Mathematics here. Yes, it is true that one can get started with competitive… Read More
Given an array arr[], the goal is to count the number of inversions in all the sub-arrays. An inversion is a pair of indices i… Read More
Given two integers A and B, and also given that Alice and Bob are playing a game starting with a bag containing N balls, in… Read More
Given a number N, and an array A[] of size 2N, the task is to make N pairs of these array elements and place them… Read More
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
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 an array arr[] consisting of N integers, the task is to repeatedly remove elements that are smaller than the next element. Examples: Input: arr[]… 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