I had an abstract algebra exam where for the last question, I couldn’t remember the theorem to do it in a sensible way, but could see that the brute force approach only needed ~40 modular multiplications. That came down to the wire!
Shockingly I got full credit, although the professor probably picked a bigger prime for her next class.