• + 0 comments

    3 line Python solution, 100%

    cnt, mod = [0] * max(len(c), max(c)+1), 1000000007
    for i in c: cnt[i]+=1
    return math.prod(x-i for i,x in enumerate(accumulate(cnt)))%mod
    

    Could get it down to 1 line with using collections.Counter instead of building the counter array cnt manully in the first 2 lines of code here, but gets a bit too ugly for 1 liner.

    ¯_(ツ)_/¯