## Find (a^b)%m where ‘b’ is very large

Given three numbers a, b and m where 1<=a, m<=10^6. Given very large 'b' containing up to 10^6 digits and m is a prime number,… Read More »

Given three numbers a, b and m where 1<=a, m<=10^6. Given very large 'b' containing up to 10^6 digits and m is a prime number,… Read More »

Given Q queries and P where P is a prime number, each query has two numbers N and R and the task is to calculate… Read More »

Given start, end and an array of N numbers. At each step, start is multiplied with any number in the array and then mod operation… Read More »

Given x, k and m. Compute (xxxx…k)%m, x is in power k times. Given x is always prime and m is greater than x. Examples:… Read More »

Given two large numbers ‘a’ and ‘b’ such that(10^20<=a, b<=10^300). Find the LCM of two large numbers given. Examples: Input: a = 234516789234023485693020129 b =… Read More »

Given a number N. Find the product of first N factorials modulo 1000000007. Constraints: 1 ≤ N ≤ 1e6 Examples: Input : 3 Output :… Read More »

Given integers x1, x2, x3……xn, b and m, we are supposed to find the result of ((x1*x2….xn)/b)mod(m). Example 1 : Suppose that we are required… Read More »

Given K, number of digits, and d0 and d1 as the two digits to form the k-sized integer. Task is to check whether the k-sized… Read More »

Given a, b and N(1 to 106). Task is to count the numbers formed by digits a and b exactly of a length N such… Read More »

Given an array of N non-negative integers, task is to find the maximum size of a subarray such that the pairwise sum of the elements… Read More »

Given an array A containing N non-negative integers. Only following operation can be performed on the array: A[i] = ( A[i] + 1 ) %… Read More »

Given A and B, the task is to find the number of possible values that X can take such that the given modular equation (A… Read More »

Given an array of N integers, using ‘+’ and ‘-‘ between the elements check if there is a way to form a sequence of numbers… Read More »

You are given a function f(n) = (n1 + n2 + n3 + n4), you have to find the value of f(n) mod 5 for… Read More »

Given two positive number N and X. The task is to find the sum of digits of a number formed by N repeating X number… Read More »