Created
September 19, 2018 15:15
-
-
Save santhosh-chinnasamy/0f1655e43dc40d4fbdd5dbd03cbc868f 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 anagram(s1,s2){ | |
var x= s1.split('').sort().join(''); | |
var y = s2.split('').sort().join(''); | |
if(x==y){ | |
console.log(x,y); | |
} | |
else{ | |
console.log("nope"); | |
} | |
} | |
anagram("and","dan") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment