## Largest number with maximum trailing nines which is less than N and greater than N-D

Given two numbers N and D. The task is to find out the largest number smaller than or equal to N which contains the maximum… Read More »

- Find minimum x such that (x % k) * (x / k) == n
- Count of pairs of (i, j) such that ((n % i) % j) % n is maximized
- Game of stones
- LCM of N numbers modulo M
- Split the number into N parts such that difference between the smallest and the largest part is minimum
- Minimum and Maximum element of an array which is divisible by a given number k
- Find last two digits of sum of N factorials
- GCD of a number raised to some power and another number
- Smallest odd digits number not less than N
- Value of the series (1^3 + 2^3 + 3^3 + ... + n^3) mod 4 for a given n
- Expressing a fraction as a natural number under modulo 'm'
- Implementation of Wilson Primality test
- Find the number of primitive roots modulo prime
- Program to find the Nth number of the series 2, 10, 24, 44, 70.....
- Numbers of Length N having digits A and B and whose sum of digits contain only digits A and B
- Sort elements of array whose modulo with K yields P

Given two numbers N and D. The task is to find out the largest number smaller than or equal to N which contains the maximum… Read More »

Question problem states that find gcd() of two numbers out of which one number can be as big as (10^9)^(10^9) which cannot be stored in… Read More »

Given three numbers A, B, and M. The task is to print the sum of A and B under modulo M. Examples: Input: a =… Read More »

Given value of N and K. The task is to find the sum of series till N-th term whose i-th term is given by Ti… Read More »

We have discussed Merge sort. How to modify the algorithm so that merge works in O(1) extra space and algorithm still works in O(n Log… Read More »

Given an integer N, the task is to find a string(considering only lowercase characters) of length (N+1) such that the character at any position should… Read More »

A Matrix series is defined as follows: M, MT, M(MT), M(MT)2, M2(MT)3, M3(MT)5, M5(MT)8 . . . . . . . ., where M is a… 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 »