Python, Sliding Window, T=O(n), S=O(1)
Intuition
This problem can be solved by Sliding Window approach, as maximum length of substring is asked.
Idea is to keep expanding the window to right in each
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->
1. This problem can be solved by Sliding Window approach, as maximum length of substring is asked. 
2. Idea is to keep expanding the window to right in each step and shrinking it from left, if it exceeds the maxCost.
# Approach
<!-- Describe your approach to solving the problem. -->
1. Initialize the left and right to 0.(tracking the window)
2. Run 'for' loop to expand the window , with 'right' as the loop variable.
3. Add the cost to currCost.
4. If the CurrCost exceeds the maxCost , shrink the window by reducing cost by left index and incrementing left variable, until it satisfies the condition.
5. Update the maxLen variable as current left,right (window) is a candidate window.
6. Return the maxLen variable.
# Complexity
- Time complexity:O(n)
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity:O(1)
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```python3 []
class Solution:
    def equalSubstring(self, s: str, t: str, maxCost: int) -> int:
        maxLen=0

        left,right=0,0
        currCost=0
        for right in range(len(s)):
            currCost+=abs(ord(s[right])-ord(t[right]))

            while currCost>maxCost:
                currCost-=abs(ord(s[left])-ord(t[left]))
                left+=1

            maxLen=max(right-left+1,maxLen)

        return maxLen

```
['String', 'Sliding Window', 'Python3']