https://www.codewars.com/kata/529eef7a9194e0cbc1000255
Codewars - Achieve mastery through coding practice and developer mentorship
A coding practice website for all programming levels – Join a community of over 3 million developers and improve your coding skills in over 55 programming languages!
www.codewars.com
DESCRIPTION:
An anagram is the result of rearranging the letters of a word to produce a new word (see wikipedia).
Note: anagrams are case insensitive
Complete the function to return true if the two arguments given are anagrams of each other; return false otherwise.
Examples
- "foefet" is an anagram of "toffee"
- "Buckethead" is an anagram of "DeathCubeK"
코드
// write the function isAnagram
var isAnagram = function(test, original) {
test = test.toUpperCase().split('').sort().join('');
original = original.toUpperCase().split('').sort().join('');
return test === original;
};
'알고리즘 > Codewars' 카테고리의 다른 글
[Codewars] Training JS #5: Basic data types--Object (8 kyu) / JavaScript (0) | 2023.04.08 |
---|---|
[Codewars] Grasshopper - Function syntax debugging (8 kyu) / JavaScript (0) | 2023.04.07 |
[Codewars] Sum of angles (7 kyu) / JavaScript (0) | 2023.04.05 |
[Codewars] Printing Array elements with Comma delimiters (8 kyu) / JavaScript (0) | 2023.04.04 |
[Codewars] Add Length (8 kyu) / JavaScript (0) | 2023.04.03 |
댓글