Algobase
Problems
Get Premium
Pricing
Problems
/
455. Assign Cookies
Prev
Next
Visualizer
Problem
Solution
Code
Standard Case
All Children Content
No Children Content
⌥
Visualizer will appear here
Problem
Solution
Code
1
def find_content_children(g, s):
2
g.sort(); s.sort()
3
left, right = 0, 0
4
while left < len(g) and right < len(s):
5
if s[right] >= g[left]:
6
left += 1
7
right += 1
8
return left
Visualizer
Standard Case
All Children Content
No Children Content
⌥
Visualizer will appear here