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 a pothole and each"."
denotes a smooth road, and an integerbudget
.In one repair operation, you can repair
n
consecutive potholes for a price ofn + 1
.Return the maximum number of potholes that can be fixed such that the sum of the prices of all of the fixes doesn’t go over the given budget.
1 | class Solution { |