From 906c48f6a9759d70c1609030343861643a872441 Mon Sep 17 00:00:00 2001 From: Atharva <atharvakhadake759@gmail.com> Date: Sat, 22 Mar 2025 16:10:03 +0530 Subject: [PATCH] Fixed Issue #684 --- apps/website/contents/algorithms/string.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/website/contents/algorithms/string.md b/apps/website/contents/algorithms/string.md index 74472413..c7c183f4 100644 --- a/apps/website/contents/algorithms/string.md +++ b/apps/website/contents/algorithms/string.md @@ -95,7 +95,7 @@ An anagram is word switch or word play. It is the result of rearranging the lett To determine if two strings are anagrams, there are a few approaches: -- Sorting both strings should produce the same resulting string. This takes O(n.log(n)) time and O(log(n)) space. +- Sorting both strings should produce the same resulting string. This takes O(n.log(n)) time and O(n) space. - 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/) - Frequency counting of characters will help to determine if two strings are anagrams. This also takes O(n) time and O(1) space.