Get Equal Substrings Within Budget
Medium
Sliding Window (Advanced)
Strings s and t have equal length. Changing s[i] to t[i] costs |s[i] - t[i]| (difference of character codes). Print the maximum length of a substring of s that can be changed into the corresponding substring of t with total cost at most maxCost.
Constraints
1 <= len(s) = len(t) <= 10^5 0 <= maxCost <= 10^6
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.