Basic Traversal of the String
Strore the largest result in the answer after every iteration.\n\nclass Solution {\npublic:\n    int maxLengthBetweenEqualCharacters(string s) {\n        int si
Strore the largest result in the answer after every iteration.\n```\nclass Solution {\npublic:\n    int maxLengthBetweenEqualCharacters(string s) {\n        int size = s.length(),ans=-1,diff=-1;\n        for(int i=0;i<size-1;i++){\n            for(int j=size-1;j>i;j--){\n                if(s[i]==s[j]){\n                    diff = j-i-1;  \n                    ans = max(diff,ans);\n                }\n            }\n        }\n        return ans;\n    }\n};\n```
['C']