← Microsoft questions

Rotate matrix elements by a given distance

Filed under Microsoft

Given an M x N 2D matrix and an integer distance k, rotate the elements along each concentric ring of the matrix clockwise by k steps.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Microsoft questions

Collected from public candidate posts and coding forums. Updated Nov 2026.