0242 Valid Anagram
Solved at: 220904
Question
Given two strings s and t, return true if t is an anagram of s, and false otherwise.
An Anagram is a word or phrase formed by rearranging the letters of a different word or phrase, typically using all the original letters exactly once.
Solution
Results
Runtime
- 129 ms, faster than 6.44% of Python3 online submissions for Valid Anagram.
Memory Usage
- 15.1 MB, less than 11.95% of Python3 online submissions for Valid Anagram.
Complexity Analysis
- Time:
- Space:
Other Answers Online
- Frequency Counter Map
alphabet → count- Time:
- Space: because the map's size is constant.
Backlinks (2)
Comments (0)