Skip to content

Tag Archives: Modular Arithmetic

Given an array arr[] of positive integers and a positive number K, the task is to find the minimum swaps of elements required such that… Read More
Given an array arr[]. The task is to minimize the number of swaps required such that for each i in arr[], arr[i]%3 = i%3. If… Read More
Given two integers N and M, the task is to find the sequence of the minimum number of operations required to convert the number N… Read More
Given three integers A, N and P, the task is to find (A^(N!)) % P. Examples:Attention reader! Don’t stop learning now. Get hold of all… Read More
Given three positive integers A, B, and N, which represent a linear congruence of the form AX=B (mod N), the task is to print all… Read More
Given three non-negative integers A, B, and N where A is non-zero, the task is to find the number of integers less than or equal… Read More
Given a positive intege N, the task is to find the number of relations that are neither reflexive nor irreflexive on a set of first… Read More
Given three integers L, R, and N, the task is to find the minimum possible value of (i * j) % N, where L ≤… Read More
Given a positive integer H, the task is to find the number of possible Binary Search Trees of height H consisting of the first (H… Read More
Given an array arr[] of size N, consisting of N / 2 even and odd integers each, and an integer K, the task is to… Read More
In programming, the modulo operation gives the remainder or signed remainder of a division, after one integer is divided by another integer. It is one… Read More
Given an array arr[] consisting of N odd integers, the task is to count the different number of ways to make the product of all… Read More
Given three positive integers X, Y, and N, such that Y < X, the task is to find the largest number from the range [0,… Read More
Given two arrays A[] and B[] consisting of N integers, the task is to minimize the total cost of incrementing or decrementing array elements by… Read More
Given an array, arr[] of size N and a positive integer M, the task is to find the maximum subarray product modulo M and the… Read More

Start Your Coding Journey Now!