lexicographical order in javascript

Solutions on MaxInterview for lexicographical order in javascript by the best coders in the world