The Barrett Reduction Algorithm computes the remainder of a big integer x divided by another large integer mod. The procedure precomputes mu, the inverse of… Read More
Category Archives: Competitive Programming
Given that 2 players are playing a die-throw game. The game is one player throws a die and he got a point, he can move… Read More
Given two integers x and y. In one step, we have to subtract the greatest common divisor of x and y from x and y… Read More
Given an N x N matrix of positive integers. The task is to find the shortest path from the first cell of the matrix to… Read More
Given an integer N and a base X, the task is to find the minimum number of operations required to represent N as a sum… Read More
Given an array arr[] of integers of size n, the task is to check if we can sort the given array in non-decreasing order(i, e.arr[i]… Read More
Given a string of size N, the task is to find the minimum operation required in a string such that all elements of a string… Read More
Link/Cut Trees is a data structure used in computer science that efficiently maintains a forest of trees under the operations of link (joining two trees… Read More
Given an array X[] and a matrix M[][]. Then the task is to output the minimum elements needed to remove so that one row and… Read More
Given an array X[] of length N, Where X[i] for (1 ≤ i ≤ N) denotes the number of rupees we need to give to… Read More
Given a binary array X[] of size N. Two players A and B are playing games having the following rules, then the task is to… Read More
IntelliJ IDEA is a popular Integrated Development Environment (IDE) used by many developers for Java programming. In this article, we’ll walk through the steps to… Read More
The reliability design problem is the designing of a system composed of several devices connected in series or parallel. Reliability means the probability to get… Read More
Given an integer N which corresponds to a N x N grid. The score you can get from a cell at the ith row and… Read More