TSMC Interview Question

How to solve difficult things