text: // Hi, I'm Yanzhan. I'm interested in all kinds of algorithmic problems. Also, I'm fascinated with javascript. If you want to learn more about programming problems and javascript, please visit my Youtube Channel (https://www.youtube.com/channel/UCDkz-__gl3frqLexukpG0DA?view_as=subscriber), Twitter Account (https://twitter.com/YangYanzhan), GitHub Repo (https://github.com/yangyanzhan/code-camp) or HomePage (https://yanzhan.site/).
  
  // 开始分析
  // 1. 按要求执行即可。
  // 结束分析
  
  // 开始编码
  
  /**
   * @param {string} s
   * @return {number}
   */
  
  var maxLengthBetweenEqualCharacters = function(s) {
      let res = -1;
      for (let i = 0; i < s.length; i++) {
          for (let j = s.length - 1; j > i; j--) {
              if (s[i] == s[j]) {
                  res = Math.max(res, j - i - 1);
                  break;
              }
          }
      }
      return res;
  };
  