Skip to content

Conversation

Neilblaze
Copy link

  • Implement next permutation algorithm. i.e
  • Given a word w, rearrange the letters of w to construct another word s in such a way that
  • s is lexicographically greater than w.
  • In case of multiple possible answers, find the lexicographically smallest one.
  • Example:
  • ab --> ba
  • bb --> bb
  • hefg --> hegf
  • dhck --> dhkc
  • dkhc --> hcdk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant