Skip to content

Instantly share code, notes, and snippets.

@xcheff
xcheff / biggerBitwise.js
Created June 13, 2023 12:55
Bigger Bitwise sequence of array
const bitwise = (arr) => arr.reduce((bitwise, value) => bitwise & value);
const sequences = (array) =>
array.flatMap((_, index, arr) => {
return arr
.slice(index)
.map((_, innerIndex) => arr.slice(index, index + innerIndex + 1));
});
const analyzeSequences = (arr) =>