Pergunta de entrevista da empresa Riot Games

Write a function that determines if a given number is odd. Follow up was to do it without using %, /, *, etc.

Respostas da entrevista

Sigiloso

24 de jul. de 2018

function isEven (val) { val = String(val); return ['0', '2', '4', '6', '8'].includes(val[val.length -1]); }

1

Sigiloso

26 de ago. de 2016

n % 2 for my initial solution, and bit wise operator for the second