# LeetCode
# 860. Lemonade Change
For $20, use $10+$5 is always better than 3*$5, because $5 is more handy than $10.
1 | |
# 441. Arranging Coins
1 | |
# 134. Gas Station
Brute-Force
TC O(N^2)
SC O(1)
Greedy
TC O(N)
SC O(1)
1 | |
# 135. Candy
Greedy
Consider from left to right and right to left respectively.
Don’t try to consider left and right simultaneously.
1 | |
# 56. Merge Intervals
Sort first and find the max right interval.
1 | |