Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Merge pull request #117 from jaichiranjeeva/67
Browse files Browse the repository at this point in the history
Issue #67 : Solve in C
  • Loading branch information
thekavikumar authored Oct 25, 2022
2 parents 29c941c + 5efcbee commit 5cb6a84
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions C/Birthday_Cake_candles.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#include <stdio.h>
int birthdayCakeCandles(int heights[],int n){
int hc=0,c=0,i=n;
while(n--)
if(c<heights[n])
c=heights[n];
while(i--)
if(c==heights[i])
++hc;
return hc;
}
int main(){
int n;
scanf("%d",&n);
int candles[n],size=n;
while(n--)
scanf("%d",&candles[n]);
printf("%d",birthdayCakeCandles(candles,size));
return 0;
}

0 comments on commit 5cb6a84

Please sign in to comment.