Skip to content

Commit e3c0c35

Browse files
committed
Do daily
1 parent d0e0708 commit e3c0c35

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

my-submissions/m781 oneliner.py

+3
Original file line numberDiff line numberDiff line change
@@ -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

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
class Solution:
2+
def numRabbits(self, answers: List[int]) -> int:
3+
output = 0
4+
for freqs, x in Counter(answers).items() :
5+
output += (freqs + 1) * (ceil(x / (freqs + 1)))
6+
return output

0 commit comments

Comments
 (0)