------
## 最终结论
```python
def maxLength(s, t, maxCost):
    costs = [abs(ord(s[i]) - ord(t[i])) for i in range(len(s))]
    
    left = 0
    total_cost = 0
    max_length = 0
    
    for right in range(len(costs)):
        total_cost += costs[right]
        
        while total_cost > maxCost:
            total_cost -= costs[left]
            left += 1
            
        max_length = max(max_length, right - left + 1)
    
    return max_length

# Example usage
s1 = "abcd"
t1 = "bcdf"
maxCost1 = 3
print(maxLength(s1, t1, maxCost1))  # Output: 3

s2 = "abcd"
t2 = "cdef"
maxCost2 = 3
print(maxLength(s2, t2, maxCost2))  # Output: 1

s3 = "abcd"
t3 = "acde"
maxCost3 = 0
print(maxLength(s3, t3, maxCost3))  # Output: 1
```