You are viewing a single comment's thread. Return to all comments →
Javascript one liner
Showoff your array knowledge
console.log(input.split("\n").slice(1).reduce((sum, val) => (/hackerrank/i.test(val) ? sum + 1 : sum), 0))
Showoff your flags knowledge
console.log(input.match(/hackerrank/gi).length);
Seems like cookies are disabled on this browser, please enable them to open this website
HackerRank Tweets
You are viewing a single comment's thread. Return to all comments →
Javascript one liner
Showoff your array knowledge
console.log(input.split("\n").slice(1).reduce((sum, val) => (/hackerrank/i.test(val) ? sum + 1 : sum), 0))
Showoff your flags knowledge
console.log(input.match(/hackerrank/gi).length);