Itron interview question

Comparator based question Coin changed problem Sort 0,1