TSMC Interview Question

leetcode style questions, but not found online, so study fundamentals