C++ || easy
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    int equalSubstring(string s, string t, int maxCost) \n    {\n        int n=s.length();\n        int i=0,j=0,ans=0,cost=0;\n        for(;j<n;j++)\n        {\n            cost+=abs(s[j]-t[j]);\n            for(;cost>maxCost;i++)\n            cost-=abs(s[i]-t[i]);\n            ans=max(ans,j-i+1);\n        }    \n        return ans;\n    }\n};\n```
['C++']