Skip to content

Instantly share code, notes, and snippets.

View imerghichi's full-sized avatar
:electron:
Focusing

Imane Merghichi imerghichi

:electron:
Focusing
View GitHub Profile
@taaha47
taaha47 / blackboard.js
Created May 2, 2020 21:32
Binary Blackboard
function bParity(c) {
return (c >>> 0).toString(2).split("1").length - 1;
}
function totalBParity(...parities) {
return [...parities].reduce((curr, nxt) => curr + nxt, 0) % 2;
}
function test(n, T) {
const nBParity = bParity(n);