spoj 21083. Lexicographically Smallest | LEXSTR

this is the most beautiful question that i have solved….

this question is more of a datastructure problem.. we have to use Union Find datastructure and a custom data structure(maplist) which allows to sort specific points of an array(sort values which are in specified indices)

there are still some optimizations to do…