Leetcode 1475. Final Prices With a Special Discount in a Shop | | Leetcode 1475. Final Prices With a Special Discount in a Shop 文章作者:Tyan博客:noahsnail.com | CSDN | 简书 1. Description 2. Solution Version 1 123456789class Solution: def finalPrices(self, prices: List[int]) -> List[int]: n = len(prices) for i in range(n-1): for j in range(i+1, n): if prices[i] >= prices[j]: prices[i] = prices[i] - prices[j] break return prices Reference https://leetcode.com/problems/final-prices-with-a-special-discount-in-a-shop/ 如果有收获,可以请我喝杯咖啡! 赏 微信打赏 支付宝打赏