Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions greedy_method/distribute_candy.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ def distribute_candy(children_ratings: list) -> int:
Input Format:
A list of Numbers representing children ratings.
Output Format:
Minium number of candies to be given.
Minimum number of candies to be given.

children_ratings = [1, 2]
>>> 3
children_ratings = [1, 5, 2, 1]
>>> 7
children_ratings = [1, 3, 2, 1]
>>> 7
>>> distribute_candy([1, 2])
3
>>> distribute_candy([1, 5, 2, 1])
7
>>> distribute_candy([1, 3, 2, 1])
7
"""

candy = [1] * len(children_ratings)
Expand Down