Easy Python code using Sorting


#1
class Solution:
# @param A : string
# @return an integer
def findRank(self, A):
    x=[t for t in A]
    x.sort()
    i=0
    r=0
    while x:
        r=r+(x.index(A[i])*math.factorial(len(x)-1))
        x.remove(A[i])
        i=i+1
    return (r+1)%1000003