Skip to main content
Code Review

Return to Revisions

2 of 2
replaced http://codereview.stackexchange.com/ with https://codereview.stackexchange.com/

The n parameter is redundant, as it should be possible to deduce the matrix dimensions from matrix itself, using matrix.length and matrix[0].length. You seem to have made the assumption that matrix is square — you should either document or relax the restriction.

I suggest writing three separate inner functions for the three possible rotations. One code-reuse technique you could use for the ±90° rotations is to combine transpose and row-swap operations.

200_success
  • 145.6k
  • 22
  • 190
  • 479
default

AltStyle によって変換されたページ (->オリジナル) /