bird sum   --------------               

Run Settings
LanguageJavaScript
Language Version
Run Command
// 6 // 1 4 4 4 5 3 function processData(input) { field = input.split("\n") arr = field[1].split(" ") arr = arr.map(Number) max = 0 count = new Array(6); count.fill(0) for (let i = 0; i < arr.length; i++) { count[arr[i]]++ } formax = 0 for (let i = 1; i < 6; i++) { if (count[i] > max) { max = count[i] formax = i } } console.log(formax); } 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