MCPcopy Create free account
hub / github.com/neetcode-gh/leetcode / rotate

Function rotate

javascript/0048-rotate-image.js:7–10  ·  view source on GitHub ↗
(matrix)

Source from the content-addressed store, hash-verified

5 * @return {void} Do not return anything, modify matrix in-place instead.
6 */
7var rotate = (matrix) => {
8 transpose(matrix); /* Time O(ROWS * COLS) */
9 reflect(matrix); /* Time O(ROWS * COLS) */
10};
11
12var transpose = (matrix) => {
13 const rows = matrix.length;

Callers

nothing calls this directly

Calls 3

transposeFunction · 0.85
reflectFunction · 0.85
reverseFunction · 0.70

Tested by

no test coverage detected