I want to implement binary search in javascript into array of arrays when output will be true or false depending if number is in array of arrays or not, but can't figure it out how to do it, could you help ?
const arr = [[3,21,37], [61,79,101,120], [133,149]];
const binarySearch = (number, array) => {
array.forEach((innerArray) => {
// binary search algorithm
});
};
binarySearch(79, arr);
true/falseas answer then why not.flat()enarrbefore doing the search.