← Salesforce questions

Rotate a square matrix by 90 degrees

Filed under Salesforce

Given an n x n matrix, rotate it by 90 degrees clockwise in place and return it. The reported version used a 4x4 example with a given expected output; the direction is assumed clockwise unless the…

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 Salesforce questions

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