X. Counting Elements
Easy
😇 Solution
class Solution:
def countElements(self, arr: List[int]) -> int:
count = 0
for a in arr:
if a+1 in arr:
count += 1
return countLast updated