Count elements where x+1 also exists in the array.
Given an integer array arr, count how many elements x such that x + 1 also exists in the array.
arr
x
x + 1