Problem Statement | |||||||||||||
An anagram of a string is any string that contains the same characters in any order. For example, the anagrams of "tree" are, in alphabetical order: "eert", "eetr", "eret", "erte", "eter", "etre", "reet", "rete", "rtee", "teer", "tere" and "tree". You will be given a String s and an int i. Return the ith (0-based) anagram of s when listed in alphabetical order. If there is no such anagram, return an empty String. | |||||||||||||
Definition | |||||||||||||
| |||||||||||||
Constraints | |||||||||||||
| - | s will contain between 1 and 20 characters, inclusive. | ||||||||||||
| - | Each character of s will be a lowercase letter ('a'-'z'). | ||||||||||||
| - | i will be between 0 and 2000000000 (2*109), inclusive. | ||||||||||||
Examples | |||||||||||||
| 0) | |||||||||||||
| |||||||||||||
| 1) | |||||||||||||
| |||||||||||||
| 2) | |||||||||||||
| |||||||||||||
| 3) | |||||||||||||
| |||||||||||||
| 4) | |||||||||||||
| |||||||||||||