Picking Numbers

  • + 0 comments

    Python

    def pickingNumbers(a):
        # Write your code here
        record = []
        for element_original in sorted(a):
            l = []
            for element_copy in sorted(a):
                l.append(element_original - element_copy)
            record.append(max(l.count(0) + l.count(1), l.count(0) + l.count(-1)))
        return max(record)