Essential Math Algorithms for Competitive Coding
Binary Exponentiation :
is a fast method to calculate powers like aⁿ , without multiplying a again and again n times. Instead of O(n) multiplications, it works in O(log n) time.
Idea Behind Binary Exponentiation
We use two simple observations :
If po...
srinivastechblog.hashnode.dev7 min read