You are viewing a single comment's thread. Return to all comments →
or, e.g. (disclaimer, this is the same implementation with sugar-syntax)
var table = new int[26]; a.ToList().ForEach(item => table[item - 'a']++); b.ToList().ForEach(item => table[item - 'a']--); return table.Sum(item => Math.Abs(item));
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 →
or, e.g. (disclaimer, this is the same implementation with sugar-syntax)