leetcode 747. Largest Number At Least Twice of Others 至少是其他數字兩倍的最大數 python list.remove()沒有返回值

NO IMAGE
class Solution:
def dominantIndex(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
max_num = max(nums)
for num in nums:
if 2*num > max_num and num != max_num:
return -1
return nums.index(max_num)