나는 이렇게 학습한다/Algorithm & SQL
1210. Bumps in the Road
daco2020
2022. 12. 11. 22:24
Your car is old, it breaks easily. The shock absorbers are gone and you think it can handle about 15 more bumps before it dies totally.
Unfortunately for you, your drive is very bumpy! Given a string showing either flat road (_) or bumps (n). If you are able to reach home safely by encountering 15 bumps or less, return Woohoo!, otherwise return Car Dead
Solution:
def bumps(road):
return road.count("n") > 15 and "Car Dead" or "Woohoo!"