You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: apps/website/contents/algorithms/string.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -95,7 +95,7 @@ An anagram is word switch or word play. It is the result of rearranging the lett
95
95
96
96
To determine if two strings are anagrams, there are a few approaches:
97
97
98
-
- Sorting both strings should produce the same resulting string. This takes O(n.log(n)) time and O(log(n)) space.
98
+
- Sorting both strings should produce the same resulting string. This takes O(n.log(n)) time and O(n) space.
99
99
- If we map each character to a prime number and we multiply each mapped number together, anagrams should have the same multiple (prime factor decomposition). This takes O(n) time and O(1) space. Examples: [Group Anagram](https://leetcode.com/problems/group-anagrams/)
100
100
- Frequency counting of characters will help to determine if two strings are anagrams. This also takes O(n) time and O(1) space.
0 commit comments