## Modulo power for large numbers represented as strings

Given two numbers sa and sb represented as strings, find ab % MOD where MOD is 1e9 + 7. The numbers a and b can… Read More »

- Count number of binary strings without consecutive 1’s : Set 2
- Minimum window size containing atleast P primes in every window of given range
- tgamma() method in C/C++ with Examples
- Count numbers less than N containing digits from the given set : Digit DP
- Count of interesting primes upto N
- Transform N to Minimum possible value
- Find minimum value of the expression by choosing K elements from given array
- Check if an array can be formed by merging 2 non-empty permutations
- fpclassify() method in C/C++ with Examples

Given two numbers sa and sb represented as strings, find ab % MOD where MOD is 1e9 + 7. The numbers a and b can… Read More »

Given the first term (A) and common difference (D) of an Arithmetic Progression, and a prime number (P). The task is to find the position… Read More »

Given three points on the X-axis which denotes the center of three line segments. The length of the line segment is also given as L.… Read More »

Given a decimal number N. The task is to find 10’s complement of the number N. Example: Input : 25 Output : 10’s complement is… Read More »

Given N, the number of digits of an integer which is greater than or equal to 2 and a weight W. The task is to… Read More »

Given a, b and c which are part of the equation x = b * ( sumdigits(x) ^ a ) + c. Where sumdigits(x) determines… Read More »

Given an array of positive integers. The task is to choose a pair of elements from the given array such that they represent the length… Read More »

Given a perimeter P, the task is to find the number of right triangles possible with perimeter equal to p. Examples: Input: P = 12… Read More »

Given a number N, you need to find a divisor of N such that the Digital Root of that divisor is the greatest among all… Read More »

Given a number n, we need to find the last two digits of 2n. Examples: Input : n = 7 Output : 28 Input :… Read More »

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 »

You are given two planes P1: a1 * x + b1 * y + c1 * z + d1 = 0 and P2: a2 *… Read More »

We have a stick of length L. The stick got broken at (n-1) randomly chosen points (lengths of parts can be non-integer or floating point… 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 »

The Haversine formula calculates the shortest distance between two points on a sphere using their latitudes and longitudes measured along the surface. It is important… Read More »