hacker rank cakes sum 

Run Settings
LanguageJavaScript
Language Version
Run Command
// converting standed out put function processData(input) { var args = input.split('\n'); var n = Number(args[0]); var candles = args[1].split(' ').map(Number); var max = Math.max.apply(null, candles); var count = 0; for (let i = 0; i < n; i += 1) { if (candles[i] === max) { count += 1; } } console.log(count); } process.stdin.resume(); process.stdin.setEncoding("ascii"); _input = ""; process.stdin.on("data", function (input) { _input += input; }); process.stdin.on("end", function () { processData(_input); });
Editor Settings
Theme
Key bindings
Full width
Lines