Created
February 12, 2022 09:55
-
-
Save AsifITk/37537a164cb4cedb39f5da49cb91811a to your computer and use it in GitHub Desktop.
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
function findBoomrangs(arr){ | |
let count = 0; | |
for(let i=0; i<arr.length-2;i++){ | |
if(arr[i] == arr[i+2]){ | |
count = count +1; | |
} | |
} | |
return count; | |
} | |
console.log(findBoomrangs([1, 7, 1, 7, 1, 7, 1])); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment