๐
Anagram Check
Anagram Check๋ณดํต ๋ฌธ์์ด +20pts
Problem
Write a function that checks if two strings are anagrams of each other.
Examples
Input:
isAnagram("listen", "silent")Output:
trueExplanation
์ด ๋ฌธ์ ๋ **์ ๋๊ทธ๋จ ํ๋ณ ์๊ณ ๋ฆฌ์ฆ**์ ํ์ตํฉ๋๋ค. ๋ฌธ์์ด ์ ๋ ฌ์ ํตํ ๋น๊ต ๋ฐฉ๋ฒ์ ์ตํ๋๋ค. **์ ๋๊ทธ๋จ์ด๋?** ๊ฐ์ ๋ฌธ์๋ค์ ์ฌ๋ฐฐ์ดํ์ฌ ๋ง๋ ๋ค๋ฅธ ๋จ์ด์ ๋๋ค: - "listen"๊ณผ "silent" โ ๊ฐ์ ๋ฌธ์ l, i, s, t, e, n - "hello"์ "world" โ ๋ค๋ฅธ ๋ฌธ์ ๊ตฌ์ฑ **์ ๋ ฌ ๊ธฐ๋ฐ ์ ๊ทผ๋ฒ** ๋ ๋ฌธ์์ด์ ๋ฌธ์๋ฅผ ์ ๋ ฌํ๋ฉด ์ ๋๊ทธ๋จ์ ๊ฐ์ ๊ฒฐ๊ณผ๊ฐ ๋ฉ๋๋ค: - "listen" โ ์ ๋ ฌ โ "eilnst" - "silent" โ ์ ๋ ฌ โ "eilnst" - ๊ฐ์ โ ์ ๋๊ทธ๋จ! **normalize ...
View detailed explanation โKey Concepts
์ ๋๊ทธ๋จ ๊ฐ๋
๋ฌธ์์ด ์ ๋ ฌ normalize ํจํด ๋ฌธ์์ด ๋น๊ต
Time: O(n log n) Space: O(n)
solution.js
Ctrl + Enter
Run tests to see results here.