Picking Numbers

  • + 0 comments
    from collections import Counter
    def pickingNumbers(a):
        # Write your code here
        freq=Counter(sorted(a))
        length_array=[]
        for i in freq:
            print(i,freq[i])
            length_array.append(freq[i]+freq[i+1])
        return max(length_array)