Anki interview question

next permutation finding anagram solved