Skip to content

Commit 63537f8

Browse files
solve(lc): p1833 - Maximum Ice Cream Bars
1 parent a78e69e commit 63537f8

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#
2+
# @lc app=leetcode id=1833 lang=python3
3+
#
4+
# [1833] Maximum Ice Cream Bars
5+
#
6+
7+
# @lc code=start
8+
class Solution:
9+
def maxIceCream(self, costs: List[int], coins: int) -> int:
10+
# sort and the choose till no coins left
11+
12+
return sum(1 for i in sorted(costs)if(coins:=coins-i)>=0)
13+
14+
15+
# @lc code=end
16+

0 commit comments

Comments
 (0)