JavaScript

292. Nim GameJavaScriptMister-Hope

Mister-Hope

/*
 * Your runtime beats 60.95 % of javascript submissions
 *
 * Your memory usage beats 24.26 % of javascript submissions (38.4 MB)
 */

const canWinNim = (n) => n % 4 !== 0;

simple

/*
 * Your runtime beats 60.95 % of javascript submissions
 *
 * Your memory usage beats 24.26 % of javascript submissions (38.4 MB)
 */

const canWinNim = (n) => Boolean(n % 4);