Documenting my progress on leetcode challenges. It also serves for the purpose of optimising my solution.
count = Counter(nums)
If a nums
is a list, count is a dictionary ordered by the decreasing frequency of the list member.
The key would be the list element, the value will be the frequency.