Given a few strings, how many strings can be lexicographically least by modifying the alphabet?
- by Jackson W
Number of strings can be huge as in 30000. Given N strings, output which ones can be lexicographically least after modifying the english alphabet. e.g. acdbe......
for example if the strings were:
omm
moo
mom
ommnom
"mom" is already lexicographically least with the original english alphabet. we can make the word "omm" least by switching "m" and "o" in the alphabet ("abcdefghijklonmpqrstuvwxyz"). the other ones you cant make lexicographically last, no matter what you do.
any fast way to do this? I have no ways to approach this except try every single possible alphabet