[LeetCode] (455) Assign Cookies

Basic idea: using a greedy algorithm, prioritize satisfying kids with lower greed and assign cookies this way as many as possible.

Implementation Apple:

Time Complexity is O(n).

 

Implementation Banana:

Time Complexity is also O(n).

Related posts