Skip to content

Instantly share code, notes, and snippets.

@anddam
Last active September 16, 2017 14:53
Show Gist options
  • Save anddam/0a5f46a7d05a1df49ee23bd626781afc to your computer and use it in GitHub Desktop.
Save anddam/0a5f46a7d05a1df49ee23bd626781afc to your computer and use it in GitHub Desktop.
#!/bin/python3
import sys
from collections import Counter
n = int(input().strip())
arr = [int(arr_temp) for arr_temp in input().strip().split(' ')]
length, counter = len(arr), Counter(arr)
for value in sorted(counter):
print(length)
length -= counter[value]
#!/bin/python3
import sys
from collections import Counter
from itertools import accumulate
n = int(input().strip())
arr = [int(arr_temp) for arr_temp in input().strip().split(' ')]
counter = Counter(arr)
print(len(arr))
for value in accumulate([counter[_] for _ in sorted(counter)][:-1]):
print(len(arr) - value)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment