algorithm1 [Leetcode] 2016. Maximum Difference Between Increasing Elements Review of the Leetcode 2016. Maximum Difference Between Increasing Elements. Below was my answer. I approached this problem as getting difference using combination not breaking the rule of the order. from itertools import combinations class Solution: def maximumDifference(self, nums: List[int]) -> int: ans = [] if nums.index(max(nums)) > nums.index(min(nums)): return max(nums)-min(nums) else: co.. 2021. 10. 26. 이전 1 다음