You are viewing a single comment's thread. Return to all comments →
c#
int count = 0; var dict = new Dictionary<int, int>(); arr.Sort(); for (int i = 0; i < arr.Count; i++) { dict.Add(arr[i], arr[i]+k); } foreach (var kv in dict) { if (dict.ContainsKey(kv.Value)) count++; } return count;
Seems like cookies are disabled on this browser, please enable them to open this website
Pairs
You are viewing a single comment's thread. Return to all comments →
c#