https://medium.com/@atmfactory27/429-leetcode-contest-minimum-number-of-operations-to-make-elements-in-array-distinct-b545f57ab927