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 {number[][]} matrix
   * @return {void} Do not return anything, modify matrix in-place instead.
   */
  
  var rotate = function(matrix) {
      let n = matrix.length;
      for (let i = 0; i < n; i++) {
          for (let j = i + 1; j < n; j++) {
              [matrix[i][j], matrix[j][i]] = [matrix[j][i], matrix[i][j]];
          }
      }
      for (let j = 0; j < Math.floor(n / 2); j++) {
          for (let i = 0; i < n; i++) {
              [matrix[i][j], matrix[i][n - 1 - j]] = [matrix[i][n - 1 - j], matrix[i][j]];
          }
      }
  };
  