GRAIL interview question

leet code medium ,stoi,top k,