基本周赛第一题都是签到题,直接遍历,双For暴破,AC!
python3
class Solution:
def maxProduct(self, nums: List[int]) -> int:
r = 0
for i in range(len(nums) - 1):
for j in range(i+1,len(nums)):
r = max(r, (nums[i]-1) * (nums[j] -1))
return r