- Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathCandy.py
More file actions
Latest commit
9 lines (7 loc) · 324 Bytes
/
Copy pathCandy.py
File metadata and controls
9 lines (7 loc) · 324 Bytes
1
2
3
4
5
6
7
8
9
'''
There are N children standing in a line. Each child is assigned a rating value.
You are giving candies to these children subjected to the following requirements:
Each child must have at least one candy.
Children with a higher rating get more candies than their neighbors.
What is the minimum candies you must give?
'''