• + 0 comments

    Python:

    def pickingNumbers(a):
        return max(
            (max(a.count(e + 1), a.count(e - 1)) + a.count(e)) for e in set(a)
        )