We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
The question is about finding (a^b)mod MOD it can be done simply by using modular exponentiation,I don't under why the editorialist used fermats little theorem and why he calculated b%(MOD-1).Any help would be highly appreciated.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Power of large numbers
You are viewing a single comment's thread. Return to all comments →
The question is about finding (a^b)mod MOD it can be done simply by using modular exponentiation,I don't under why the editorialist used fermats little theorem and why he calculated b%(MOD-1).Any help would be highly appreciated.