Kloudrac interview question

Coding Problem Was Given to solve within 20 mins