Daily Cookie
ABC 382Problem 34 of 50
EasyWhat to do
Given a string of boxes where '@' = cookie and '.' = empty, Takahashi eats one cookie per day for `d` days. Count how many boxes will be empty after d days. Empty boxes = original empty boxes + d cookies eaten.
Key Concepts
Strings
Loops
Counting
Conditionals
Examples
Input:
n = 5, d = 2, s = '.@@.@'
Output:
4
Input:
n = 3, d = 3, s = '@@@'
Output:
3
Tips for Beginners
- Focus on understanding the logic, not memorizing syntax
- Use print statements to debug your code
- Don't worry about input parsing - the function handles that for you
- If stuck, try writing out your solution on paper first
Python Editor
Loading Python...