Answers for "birthday cake candles hackerrank solution in javascript"

0

birthday cake candles hackerrank solution in javascript

let max = candles.reduce((a,b)=>{
     return Math.max(a,b)
 })
 let number = 0;
for(let i=0; i<candles.length; i++){
    if(candles[i] == max){
      number += 1  
    }
}
return number
// Paste this code inside the function.
Posted by: Guest on October-19-2021
0

birthday cake candles hackerrank solution

#include <assert.h>#include <limits.h>#include <math.h>#include <stdbool.h>#include <stddef.h>#include <stdint.h>#include <stdio.h>#include <stdlib.h>#include <string.h>/*Birthday Cake Candles Code in C*/int main() {int i;int n;int max = 0;scanf("%d", & n);int a[n];int count = 0;for (i = 1; i <= n; i++) {scanf("%d", & a[i]);if (max < a[i])max = a[i];}for (i = 1; i <= n; i++)if (a[i] == max)count++;printf("%d", count);return 0;}
Posted by: Guest on August-04-2021

Code answers related to "birthday cake candles hackerrank solution in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language