Picking Numbers

  • + 0 comments

    Python solution

    def pickingNumbers(a):
        num_counter = Counter(a)
        return max(
            num_counter[num] + num_counter[num + 1]
            for num in num_counter.keys()
        )