Python Easy To understand


  • 0
    B

    Any optimization?

    """

        m = max(nums)
        index = -1
        for i, n in enumerate(nums):
            if n == 0:
                continue
            if m == n:
                index = i
                continue
            if m - n < n:
                print m, n, i
                return -1
        return index
    

    """


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.