Paytm interview question

group concatenation