Google Interview Question

2 LC hard problems and 2 medium