HTMLify

LeetCode - Final Prices With a Special Discount in a Shop - Python
Views: 2 | Author: abh
class Solution:
    def finalPrices(self, prices: List[int]) -> List[int]:
        for i in range(len(prices)-1):
            for j in range(i+1, len(prices)):
                if prices[i] >= prices[j]:
                    prices[i] -= prices[j]
                    break
        return prices

Comments