We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1fb93a6 commit 48709caCopy full SHA for 48709ca
scripts/algorithms/S/Shopping Offers/Shopping Offers.py
@@ -1,3 +1,4 @@
1
+# Runtime: 164 ms (Top 43.73%) | Memory: 14 MB (Top 84.10%)
2
class Solution:
3
def shoppingOffers(self, price: List[int], special: List[List[int]], needs: List[int]) -> int:
4
def dfs(price, special, needs, memo = {}):
@@ -21,4 +22,4 @@ def dfs(price, special, needs, memo = {}):
21
22
res.append(dfs(price, special, new_needs, memo) + offer[-1])
23
memo[tuple(needs)] = min(res)
24
return min(res)
- return dfs(price, special, needs)
25
+ return dfs(price, special, needs)
0 commit comments