You are viewing a single comment's thread. Return to all comments →
This would be the C# version of your code:
var numbers = arr.ToList();
return arr.Where(x => numbers.Contains(x - k)).Count();
Pairs
You are viewing a single comment's thread. Return to all comments →
This would be the C# version of your code:
var numbers = arr.ToList();
return arr.Where(x => numbers.Contains(x - k)).Count();