LinkedIn Interview Question

2 Medium level DS/Algo problems