Given a large number n and a prime p, how to efficiently compute n! % p?Examples : Input: n = 5, p = 13 Output:… Read More
Tag Archives: large-numbers
Given three numbers n, r and p, compute the value of nCr mod p. Examples: Input: n = 10, r = 2, p = 13… Read More
Given three numbers n, r and p, compute value of nCr mod p. Example: Input: n = 10, r = 2, p = 13 Output: 6… Read More
BigInteger class is used for the mathematical operation which involves very big integer calculations that are outside the limit of all available primitive data types.… Read More
Given three numbers x, y and p, compute (xy) % p. Examples : Input: x = 2, y = 3, p = 5 Output: 3… Read More
Given a big number ‘num’ represented as string and an integer x, find value of “num % a” or “num mod a”. Output is expected… Read More
Given two numbers represented by two linked lists, write a function that returns the sum of the two linked lists in the form of a… Read More