LinkedIn Interview Question

A question about modular inverse basically had a pnc problem