# Category Archives: Competitive Programming

As we all know, while solving any CP problems, the very first step is collecting input or reading input. A common mistake we all make… Read More
It’s time for the final exam in algorithms and data structures! Edsger prepared N sets of problems. Each set consists of problems in an increasing… Read More
Given an array arr[ ] of size N and an integer p, the task is to find maximum possible value of rightmost element of array… Read More
With robotics technology moving rapidly ahead of itself, it has become very important for developers to meet software needs. The hardware mechanics have become very… Read More
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 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