Rotate a Rectangular Image Clockwise
Problem statement
Given an H × W grayscale integer image, return a new W × H image rotated 90 degrees clockwise.
Function
rotateClockwise(image: int[][]) → int[][]Examples
Example 1
image = [[1,2,3],[4,5,6]]return = [[4,1],[5,2],[6,3]]The first output row is the original first column read bottom to top.
Constraints
1 <= H, W <= 200.- Every row has exactly
Wentries.