Photo by Thought Catalog on Unsplash

Photo by Clément H on Unsplash

Photo by Tj Holowaychuk on Unsplash

Photo by Joshua Sortino on Unsplash
Create a function that takes an integer N and returns a NxN spiral matrix.//     matrix(4)
// [[1, 2, 3, 4],
// [12, 13, 14, 5],
// [11, 16, 15, 6],
// [10, 9, 8, 7]]

Photo by Sora Sagano on Unsplash

Photo by Blake Connally on Unsplash
let…

Photo by Ahmad Dirini on Unsplash
Rotate a 2D array (n x n matrix) 90 degree close-wise without creating a new array. For example:
Input:
const A =
[[ 1, 2, 3, 4],
[ 5, 6, 7, 8],
[ 9, 10, 11, 12],
[13, 14, 15, 16]]
rotate(A); // a functionOutput:
console.log(A);

https://twitter.com/dan_abramov/status/981712092611989509

Mounting

These methods will be called when an instance of a React component is…

Ngoc Vuong

Self-taught JS developer and Front-end Developer who is learning to write and share what she has learned. https://dragonza.io

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store