Algorithm · Capital One · Medium
Requirements You receive an n x m matrix of integers together with an ordered collection of command strings. These command forms are valid: reverseRow r — invert the order of values in row r. swap r1 r2 — exchange rows r1 and r2. rotate — turn the matrix 90 degrees clockwise. Its size changes from n x m to m x n, and later row references use these new dimensions. Apply every command sequentially, then return the resulting matrix. Examples Starting with the 2 x 3 matrix…
Checking your access…