Skip to content

Commit

Permalink
Create e1475 oneliner.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Zanger67 authored Dec 19, 2024
1 parent b5f7287 commit 69aa3db
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions my-submissions/e1475 oneliner.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
class Solution:
def finalPrices(self, prices: List[int]) -> List[int]:
return [prices[i] - min([(indx, discount) for indx, discount in enumerate(prices[i + 1 :]) if discount <= prices[i]] + [(inf, 0)], key=lambda x: x[0])[1] for i in range(len(prices))]

0 comments on commit 69aa3db

Please sign in to comment.