Problem library

Win Streak

Easy
stringscounting

A player's recent results are a string of W (win) and L (loss), oldest first.

Return the length of their longest run of consecutive wins.

Examples

Input: results = "WWLWWWL"
Output: 3
Input: results = "LLL"
Output: 0