Code Coach - Word Rank. Please see my code. It failed all the test cases.
Hello. This is the instruction > Input is a string (word) representing a sequence of letters ( A - Z ). It can contain duplicate letters. Rearranging the letters in the word, you can come up with new words composed of the same letters. The output is an integer representing the rank of the inputted word ( sorted alphabetically ). My code failed all the test cases. It hangs up when a long word is being inputted. I hope someone can give me a hint so that I can revise my code. Thank you. https://code.sololearn.com/c3hbuw6yJwm6/?ref=app https://code.sololearn.com/c3hbuw6yJwm6/?ref=app