class Solution(object):

    def countElements(self, arr):
        st = set(arr)
        return len([x for x in arr if x + 1 in st])

b6723806f8562c9a278dba2a53bf5b439760557f
<mask token>

class Solution(object):
    <mask token>

class Solution(object):

    def countElements(self, arr):
        st = set(arr)
        return len([x for x in arr if x + 1 in st])
