From 63b2fa39223f28ad5de3b298dd3e496ae7bd460c Mon Sep 17 00:00:00 2001 From: itai Date: Fri, 25 Sep 2020 18:43:56 +0300 Subject: [PATCH] changed isAnagram algorythm to other logic this is my first commit to a public repo, so i don't know if i'm doing it right --- Algorithms/Strings/Permutations.cs | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/Algorithms/Strings/Permutations.cs b/Algorithms/Strings/Permutations.cs index fe15d8a9..80f54c0c 100644 --- a/Algorithms/Strings/Permutations.cs +++ b/Algorithms/Strings/Permutations.cs @@ -73,19 +73,12 @@ public static bool IsAnargram(string source, string other) return true; int len = source.Length; - // Hash set which will contains all the characters present in input source. - var hashSetSourceChars = new HashSet(); - var hashSetOtherChars = new HashSet(); - for (int i = 0; i < len; i++) + for(int i = 0; i