Java Brute Force Solution
Java Easy Solution\n\npublic int maxLengthBetweenEqualCharacters(String s) {\n        int count = 0;\n    \t int ans = -1;\n    \t for (int i = 0; i < s.length(
Java Easy Solution\n``` \npublic int maxLengthBetweenEqualCharacters(String s) {\n        int count = 0;\n    \t int ans = -1;\n    \t for (int i = 0; i < s.length()-1; i++) {\n\t\t\tfor (int j = i+1; j < s.length(); j++) {\n\t\t\t\tif(s.charAt(i)==s.charAt(j)) {\n\t\t\t\t\tcount = j-i-1;\n\t\t\t\t\tif(ans<count) {\n\t\t\t\t\t\tans = count;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn ans;\n    }\n\t```\n\t
['Java']