3119. Maximum Number of Potholes That Can Be Fixed

You are given a string

`road`

, consisting only of characters`"x"`

and`"."`

, where each`"x"`

denotes apotholeand each`"."`

denotes a smooth road, and an integer`budget`

.In one repair operation, you can repair

`n`

consecutivepotholes for a price of`n + 1`

.Return the

maximumnumber of potholes that can be fixed such that the sum of the prices of all of the fixesdoesn’t go overthe given budget.

1 | class Solution { |