Skip to content

Commit

Permalink
Create Birthday_Cake_Candles cognizance-amrita#67.py
Browse files Browse the repository at this point in the history
To solve this issue we can get the maximum height from the list of candles and then count how many times that maximum height occurs in the list, which was possible using a for loop.
  • Loading branch information
IndexPosition authored Oct 20, 2022
1 parent 5c5847f commit 83746c9
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions python/Birthday_Cake_Candles #67.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
n = int(input())
candles = list(map(int, input().split()))

max_height = max(candles)
count = 0
for i in candles:
if i == max_height:
count += 1
print(count)

0 comments on commit 83746c9

Please sign in to comment.