Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/neetcode-gh/leetcode
/ swap2
Function
swap2
javascript/0048-rotate-image.js:44–48 ·
view source on GitHub ↗
(matrix, row, col, reflection)
Source
from the content-addressed store, hash-verified
42
};
43
44
var
swap2 = (matrix, row, col, reflection) =>
45
([matrix[row][col], matrix[row][reflection]] = [
46
matrix[row][reflection],
47
matrix[row][col],
48
]);
49
50
/**
51
* Time O(ROWS * COLS) | Space O(1)
Callers
1
reflect
Function · 0.85
Calls
no outgoing calls
Tested by
no test coverage detected