Search
⌘K
Get Premium
Leetcode 1208. Get Equal Substrings Within Budget
Given two equal-length strings and a budget, find the maximum-length contiguous substring where the sum of per-character absolute ASCII differences between s and t is <= maxCost. This is solved by a sliding-window/two-pointer approach to maintain the running cost and maximize window length in O(n).
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.