Skip to content

Instantly share code, notes, and snippets.

@Rhriti
Created January 14, 2023 07:32
Show Gist options
  • Save Rhriti/07487329ab6dc2b0a23f5b546b8dd54f to your computer and use it in GitHub Desktop.
Save Rhriti/07487329ab6dc2b0a23f5b546b8dd54f to your computer and use it in GitHub Desktop.
bloggerpost
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
@Rhriti
Copy link
Author

Rhriti commented Jan 14, 2023

experiment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment