Verily interview question

LC easy and LC hard