Task:
My Code:
function isNice(arr){
for(let i = 0; i < arr.length; i++){
let n = arr[i]
if (arr.indexOf(n-1)==-1 && arr.indexOf(n+1)==-1){return false}
}
return true
}
My code passes 90%+ of the test cases. I can’t quite think of the edge cases where my code would return an incorrect answer?