# Category Archives: Competitive Programming

MO’s Algorithm is an algorithm designed to efficiently answer range queries in an array in linear time. It is a divide-and-conquer approach that involves pre-processing… Read More
Given a matrix mat[][] of size N*M, the task is to find the minimum value in a submatrix of the array, defined by the top-left… Read More
The Mobius inversion formula is a technique used in number theory to find the inverse of an arithmetic function. It is based on the Mobius… Read More
Convolution is a mathematical operation used in signal processing, image processing, and other fields to combine two functions in order to produce a third function.… Read More
Every coder wants to be the best! For this, one has to prove himself/herself regularly, and what’s the best way to do so if not… Read More
Given an Array A[] of size N with repeated elements and all array elements are positive, the task is to find the maximum sum by… Read More
Dirichlet convolution is a mathematical operation that combines two arithmetic functions to create a third function. It is named after the mathematician Peter Gustav Lejeune… Read More
Given a 2D Graph, present initially at (0, 0). Print “YES” if the given point (X, Y) lies on the spiral path, otherwise “NO“. The… Read More
Given a string S of length N where (N ≥ 1). The task is to check whether by removing at most one character from the… Read More
Gaussian Distribution The Gaussian distribution is a continuous probability distribution that is commonly used to represent real-valued random variables. It is also known as the… Read More
Given an array, arr[] of size n. Calculate the sum of arr[] by performing k queries on arr[], such that we have to add an… Read More
Given N number of integers in sorted format, where each integer Ai for all(1 ≤ i ≤ N), denotes the join of two points (0,… Read More
Given a positive integer arr[] of length L (2 ≤ L ≤ 2000) containing elements from 1 to L in unsorted order and an integer… Read More
Competitive Programming is a mind sport where time matters the most. For that, a fast and easy-to-use tool is required for writing code. Sublime text… Read More
Given binary string S of length N, the task is to minimize cost to sort the binary string using the following operations: Operation-1: Take any… Read More