Solving Get Equal Substrings Within Budget in go. Please try yourself first to solve the problem and submit your implementation to LeetCode before looking into solution.

Problem Description

Example 1:

Input: s = "abcd", t = "bcdf", maxCost = 3
Output: 3
Explanation: "abc" of s can change to "bcd". That costs 3, so the maximum length is 3.

Example 2:

Input: s = "abcd", t = "cdef", maxCost = 3
Output: 1
Explanation: Each character in s costs 2 to change to charactor in t, so the maximum length is 1.

Example 3:

Input: s = "abcd", t = "acde", maxCost = 0
Output: 1
Explanation: You can't make any change, so the maximum length is 1.

Constraints:

  • 1 <= s.length, t.length <= 10^5

  • 0 <= maxCost <= 10^6

  • 1 <= s.length, t.length <= 10^5

  • 0 <= maxCost <= 10^6

See the full details of the problem Get Equal Substrings Within Budget at LeetCode

Originally posted at: @github.com/halfrost/LeetCode-Go