Created
January 14, 2023 07:32
-
-
Save Rhriti/07487329ab6dc2b0a23f5b546b8dd54f to your computer and use it in GitHub Desktop.
bloggerpost
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Solution: | |
def numRabbits(self, answers) : | |
#lol its code is damn easy | |
from collections import Counter | |
import math | |
arr=Counter(answers) | |
tc=0 | |
for key,value in arr.items(): | |
tc+=math.ceil(value/(key+1))*(key+1) | |
return tc | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
experiment