1
2
3
4
5
6
7
|
class Solution:
def maxProduct(self, nums: List[int]) -> int:
first=max(nums)
nums.pop(nums.index(first))
second=max(nums)
ans=(first-1)*(second-1)
return ans
|
cs |
반응형
'python-algorithm' 카테고리의 다른 글
leetcode 2000. Reverse Prefix of Word (0) | 2022.03.16 |
---|---|
leetcode 1704. Determine if String Halves Are Alike (0) | 2022.03.16 |
leetcode 125. Valid Palindrome (0) | 2022.03.15 |
leetcode 2108. Find First Palindromic String in the Array (0) | 2022.03.15 |
leetcode 2176. Count Equal and Divisible Pairs in an Array (0) | 2022.03.15 |
댓글