Created
December 12, 2020 00:21
-
-
Save OverlappingElvis/93a5a5a72220bbad417f9c701e516569 to your computer and use it in GitHub Desktop.
menorah math
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const allCandles = (new Array(256)).fill(256).map((val, index) => (index).toString(2).padStart(8, 0)) | |
const nonsymmetricCandles = allCandles.reduce((memo, candles) => { | |
if (memo.includes([...candles].reverse().join(''))) { | |
return memo | |
} | |
memo.push(candles) | |
return memo | |
}, []) | |
console.log(JSON.stringify(nonsymmetricCandles)) | |
console.log(nonsymmetricCandles.length) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment