• + 2 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.