Find The Rank Of A Word Definition
The rank of a word is defined as the position of the word when all the possible permutations (or arrangements) of its letters are arranged alphabetically, like in a dictionary, no matter if the words are meaningful or not.
Let us consider these two words - &quot;blue&quot; and &quot;seen&quot;. To begin with, we would write all the possible arrangements of the letters of these words in alphabetical order:
&quot;blue&quot;: &quot;belu&quot;,&quot;beul&quot;,&quot;bleu&quot;,&quot;blue&quot;,&quot;buel&quot;,&quot;bule&quot;,&quot;eblu&quot;,&quot;ebul&quot;,&quot;elub&quot;,&quot;elbu&quot;,&quot;eubl&quot;,
        &quot;eulb&quot;,&quot;lbeu&quot;,&quot;lbue&quot;,&quot;lebu&quot;,&quot;leub&quot;,&quot;lube&quot;,&quot;lueb&quot;,&quot;ubel&quot;,&quot;uble&quot;,&quot;uebl&quot;,&quot;uelb&quot;,
        &quot;ulbe&quot;,&quot;uleb&quot;
&quot;seen&quot;: &quot;eens&quot;,&quot;eesn&quot;,&quot;enes&quot;,&quot;ense&quot;,&quot;esen&quot;,&quot;esne&quot;,&quot;nees&quot;,&quot;nese&quot;,&quot;nsee&quot;,&quot;seen&quot;,
        &quot;sene&quot;,&quot;snee&quot;

Now let's look from the left and find the position of the words we need. We see that the word &quot;blue&quot; is at the 4th position and &quot;seen&quot; is at 10th position. So the rank of the word &quot;blue&quot; is 4, and that of &quot;seen&quot; is 10. This is the general way of calculating the rank of a word. Make sure you start counting from 1 only.
Task
Your task is to write a code to take any word as an input and display its rank. The rank should be the output.
Be careful about words containing repeated letters.
Examples
&quot;prime&quot; -&gt; 94

&quot;super&quot; -&gt; 93

&quot;bless&quot; -&gt; 4

&quot;speech&quot; -&gt; 354

&quot;earth&quot; -&gt; 28

&quot;a&quot; -&gt; 1

&quot;abcd&quot; -&gt; 1

&quot;baa&quot; -&gt; 3    

You can assume the input to be completely in lowercase and the input will only contain alphabetical characters. Also if a blank space or an invalid string is entered, you may return anything.
Scoring
This is code-golf , so the shortest code wins!
Python 3, 71 bytes



lambda s:sum(t&lt;=(*s,)for t in{*permutations(s)})
from itertools import*


Try it online!