Last active
January 10, 2020 23:43
-
-
Save amejiarosario/82db4f64184b6fe024c1d15f2b3ae05c to your computer and use it in GitHub Desktop.
This file contains hidden or 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 hasDuplicates(n) { | |
const duplicates = []; | |
for (let outter = 0; outter < n.length; outter++) { | |
for (let inner = 0; inner < n.length; inner++) { | |
if(outter === inner) continue; | |
if(n[outter] === n[inner]) { | |
return true; | |
} | |
} | |
} | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment