Rotate Image

Medium · Arrays & Strings · about 15 minutes

Asked at Bloomberg, Apple, Amazon, Google, Microsoft, Meta.

Given an n × n matrix, rotate it 90 degrees clockwise in place and return it.

Related guides