Category Archives: Competitive Programming

Given an array of integers Arr. The task is to count the number of triplets (i, j, k) such that Ai ^ Ai+1 ^ Ai+2… Read More
Given an array A containing N integers. Find the maximum sum possible such that exactly floor(N/2) elements are selected and no two selected elements are… Read More
Given is an array Arr of integers. The task is to determine if the array has any subsequence of at least length 3 that is… Read More
A Geometric series is a series with a constant ratio between successive terms. The first term of the series is denoted by a and the… Read More
Periodic Binary String : A Binary string is called periodic if it can be written as repetition of a binary string of smaller or same… Read More
Many times while solving problems, we face issues like time limit exceeds, wrong solution, runtime error, and memory limit exceeds because after designing algorithm we… Read More
Given an array arr[] of size N which contains at least one composite number. The task is to find out the sum of all the… Read More
Given an array arr[] of length n and a positive integer K, we have to find a subarray of length K which has maximum peak… Read More
Given a positive number N, we have to find whether N can be converted to the form KK where K is also a positive integer,… Read More
Given an integer N and two players, A and B are playing a game. On each player’s turn, that player makes a move by subtracting… Read More
Given Four integers N, K, P and Q. The task is to calculate the number of ways to arrange N numbers which are in a… Read More
Given an array A containing N positive integers, the task is to find the number of subarrays of this array such that in each subarray,… Read More
Given an undirected graph of N nodes labelled from 1 to N, the task is to find the minimum labelled node that should be removed… Read More
Given an array A consisting of N non-negative integers, the task is to choose an integer K such that the maximum of the xor values… Read More