The objective is to implement a function that will return all pairs of integers from a given array of integers that have a difference of 2. The res...
For further actions, you may consider blocking this person and/or reporting abuse
Python solution
Whoa, that reads almost as if it were English!
Thanks!
C++ solution
Something like this should do it in JavaScript. I'm not entirely sure if this sort is okay, though. I can never remember which way it's ascendent and which descendent.
This really is Savage
Ruby solution
JS solution
Took some iterations to get to this solution, but here it is.
Haskell:
My Swift solution :
JS solution with reduce
JS Solution
output:
JavaScript
Assuming the input should be an array of unsigned integers.