## Sort the given stack elements based on their modulo with K

Given a stack of integers and an integer K, the task is to sort the elements of the given stack using another stack in the… Read More »

## Minimum possible value of (i * j) % 2019

Given two integers L and R, the task is to find the minimum possible value of (i * j) % 2019 where L ≤ i… Read More »

## Modulo of a large Binary String

Given a large binary string str and an integer K, the task is to find the value of str % K. Examples: Input: str =… Read More »

## Sort elements by modulo with K

Given an array arr[] of integers and an integer K. The task is to sort the elements of the given array in the increasing order… Read More »

## Sum of all natural numbers from L to R ( for large values of L and R )

Given two very large numbers L and R where L ≤ R, the task is to compute the sum of all the natural numbers from… Read More »

## Modular Exponentiation of Complex Numbers

Given four integers A, B, K, M. The task is to find (A + iB)K % M which is a complex number too. A +… Read More »

## Count of all possible values of X such that A % X = B

Given two integers A and B. The task is to find the count of all possible values X such that A % X = B.… Read More »

## Length of the smallest number which is divisible by K and formed by using 1’s only

Given an integer K, the task is to find the length of the smallest no. N which is divisible by K and formed by using… Read More »

## Find 2^(2^A) % B

Given two integers A and B, the task is to calculate 22A % B. Examples: Input: A = 3, B = 5 Output: 1 223… Read More »

## Find the value of XXXX…..(N times) % M where N is large

Given three integers X, N and M. The task is to find XXX…(N times) % M where X can be any digitfrom the range [1,… Read More »

## Find N % 4 (Remainder with 4) for a large value of N

Given a string str representing a large integer, the task is to find the result of N % 4. Examples: Input: N = 81 Output:… Read More »

## Numbers of Length N having digits A and B and whose sum of digits contain only digits A and B

Given three positive integers N, A and B. The task is to count the numbers of length N containing only digits A and B and… Read More »

## Count of pairs of (i, j) such that ((n % i) % j) % n is maximized

Given an integer n, the task is to count the number of pairs (i, j) such that ((n % i) % j) % n is… Read More »

## Find minimum x such that (x % k) * (x / k) == n

Given two positive integers n and k. Find minimum positive integer x such that the (x % k) * (x / k) == n, where… Read More »

## LCM of N numbers modulo M

Given an array arr[] of integers, the task is to find the LCM of all the elements of the array modulo M where M =… Read More »