help in triple sort question from code chef long challenge of may 2020 https://www.codechef.com/viewsolution/32992756