You are viewing a single comment's thread. Return to all comments →
public static int NumbersRequiredToDeleteFromBothStrings(string first, string second) { for (var i = 0; i < first.Length; i++) { var c = first[i]; int index = second.IndexOf(c); if (index >= 0) { second = second.Remove(index, 1); first = first.Remove(i, 1); i--; } } return first.Length + second.Length; }
Seems like cookies are disabled on this browser, please enable them to open this website
Strings: Making Anagrams
You are viewing a single comment's thread. Return to all comments →