Fast Exponentiation

In many Competitive programming problems, you are asked to find ( a^n ) % mod, where n is in between 0 to 10^12.
This video will show you how you can find ( a^n ) % mod in O(log n) complexity.

No comments

Powered by Blogger.