Given a string, find the rank of the string amongst its permutations sorted lexicographically.
Assume that no characters are repeated.
Input : 'acb' Output : 2 The order permutations with letters 'a', 'c', and 'b' : abc acb bac bca cab cba
The answer might not fit in an integer, so return
your answer % 1000003
NOTE: You only need to implement the given function. Do not read input, instead use the arguments to the function. Do not print the output, instead return values as specified. Still have a doubt? Checkout Sample Codes for more details.