1
2
3
4
|
class Solution:
def maxProductDifference(self, nums: List[int]) -> int:
nums=sorted(nums)
return nums[-1]*nums[-2]-nums[0]*nums[1]
|
cs |
반응형
'python-algorithm' 카테고리의 다른 글
Leetcode 1859. Sorting the Sentence (0) | 2021.07.16 |
---|---|
백준 3029 경고 (0) | 2021.07.16 |
Leetcode 1486. XOR Operation in an Array (0) | 2021.07.16 |
Leetcode 1791. Find Center of Star Graph (0) | 2021.07.16 |
Leetcode 1221. Split a String in Balanced Strings (0) | 2021.07.16 |
댓글