You are viewing a single comment's thread. Return to all comments →
C# 2 liner
static int pairs(int[] a, int k) { HashSet<int> numbers = new HashSet<int>(a); return a.Where(x=>numbers.Contains(x+k)).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# 2 liner