How to find Nth term of any linear recurrence relation in O( logN ) 4/30/2020 11:48:00 AM 5 min read Motivation: Given a sequence with a recurrence relation. Find is the Nth term of the sequence. Example: Fibonacci sequen...
Fast Exponentiation 9/30/2018 03:41:00 AM 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 ...
Calculate nCr % m in O(n) 9/30/2018 03:36:00 AM Many problems in competitive programming require to calculate nCr % m. And this video will s...
Distributing Balls into Boxes 9/30/2018 03:27:00 AM Here, we are counting the number of ways in which k balls can be distributed into n boxes under various conditions. The conditions ...
Stars and Bars Theorem 9/30/2018 03:27:00 AM Stars and Bars Theorem Consider the equation where are non-negative integers. We're looking for the number of solutions ...