- Library
- Challenges
- Python
Longest win streak
Given a season of match results, find the longest run of wins in a row.
Write longest_streak(results). results is a list of "W" (win) and "L" (loss) in match order. Return the length of the longest run of "W" in a row. A season with no wins returns 0.
Python
longest_streak(["W", "W", "L", "W", "W", "W", "L"]) # 3Checks
- A streak in the middle
- Edges and empty seasons
exercise_1.py to run
def longest_streak(results):
pass