We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
I use max function in list. 7 out of 8 test cases work. I am not sure what's wrong with my code. Can you please have a look ?
n1=input().strip()# Input age valueb1=input().strip().split()# Input list of candle heightsdefbirthdayCakeCandles(n,b):c=0z=max(b)foriinb:ifi==z:c+=1return(c)y=birthdayCakeCandles(n1,b1)print(y)
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Birthday Cake Candles
You are viewing a single comment's thread. Return to all comments →
I use max function in list. 7 out of 8 test cases work. I am not sure what's wrong with my code. Can you please have a look ?