C++ py3 C Rust adjacent difference與loop速解Leetcode 1526 Minimum Number of Increments on Subarrays to Form a Target Array
[Py3一行解請進]
class Solution:
    def minNumberOperations(self, t: List[int]) -> int:
        return t[0]+sum(max(x-y, 0) for x, y in zip(t[1:], t))
 
   
 
 
沒有留言:
張貼留言