You are viewing a single comment's thread. Return to all comments →
JavaScript (Node.js) - Without Conditional Statements
let [n, ...s] = input.trim().split('\n') s.forEach(i => { let [, start='', end=''] = i.match(/(.)*hackerrank(.)*/) || [] console.log([[0, 1], [2, -1]][start.length][end.length]) })
Seems like cookies are disabled on this browser, please enable them to open this website
Find HackerRank
You are viewing a single comment's thread. Return to all comments →
JavaScript (Node.js) - Without Conditional Statements