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…

https://gist.github.com/e23264b80e1d276b6a22

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s