This file contains 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 findSingle = (arr) => { | |
let obj = {} | |
for(let item of arr ){ | |
if(obj[item]{ | |
obj[item]+= 1 | |
}else{ | |
obj[item] = 1 |
This file contains 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 sortedArray = [1,3,5,5,7,8,11,12,14,14,15,16,16,17,17,17,17,18,19,19,19]; | |
const bs = (arr, target) => { | |
let start = 0; | |
let end = arr.length - 1; | |
let tries = 1; | |
while(start <= end){ | |
console.log("TRY NUMBER ", tries); |