We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d0e0708 commit e3c0c35Copy full SHA for e3c0c35
my-submissions/m781 oneliner.py
@@ -0,0 +1,3 @@
1
+class Solution:
2
+ def numRabbits(self, answers: List[int]) -> int:
3
+ return sum((freqs + 1) * (ceil(x / (freqs + 1))) for freqs, x in Counter(answers).items())
my-submissions/m781.py
@@ -0,0 +1,6 @@
+ output = 0
4
+ for freqs, x in Counter(answers).items() :
5
+ output += (freqs + 1) * (ceil(x / (freqs + 1)))
6
+ return output
0 commit comments