0

I tried to solve the spiral matrix problem, But I am facing some issues with my logic.
Code below
const arr = [
[1,2,3,4],
[5,6,7,8],
[9,10,11,12]]
function spiralOrderMatrix(arr) {
let top = 0;
let left = 0;
let right = arr[0].length - 1;
let bottom = arr.length - 1;...