ABC Interview Question

2 DSA Q Med, Hard