Given an integer array
arr
, count how many elementsx
there are, such thatx + 1
is also inarr
. If there are duplicates inarr
, count them separately.
1 | class Solution { |
Given an integer array
arr
, count how many elementsx
there are, such thatx + 1
is also inarr
. If there are duplicates inarr
, count them separately.
1 | class Solution { |