Ranked

Run Settings
LanguageJavaScript
Language Version
Run Command
function processData(input) { let string = input.split('\n'); let ranked = string[1].split(" ").map(Number) let player = string[3].split(" ").map(Number) ranked = [...new Set(ranked)] for(let i = 0 ; i< player.length ;i++){ for(let j = 0 ; j< ranked.length ;j++){ if(player[i] >= ranked[j] ){ console.log(j + 1) break; }else if(j == ranked.length - 1 ){ console.log(ranked.length + 1) } } } } 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