Rotate a Rectangular Image Clockwise
Updated
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.
More Luma AI Online Assessment questions
- Build a Gaussian Blur KernelOA · Seen Jun 2026
- Center Crop a Grayscale ImageOA · Seen Jun 2026
- Impute Missing Values and Normalize ColumnsOA · Seen Jun 2026
- Minimum Euclidean Distance Between PointsOA · Seen Jun 2026
- Numerically Stable SoftmaxOA · Seen Jun 2026
- Triangle Flags from Adjacent ElementsOA · Seen Jun 2026
Similar questions at other companies
- Survey Table: Group Given an AnswerSusquehanna International Group (SIG) · OASusquehanna International Group (SIG) interview questions
- Wind-Blown Leaves Remaining in a GridAbridge · OAAbridge interview questions
- Query a Header-Encoded MatrixNVIDIA · OANVIDIA interview questions
- Trapped Characters in a GridAdobe · OAAdobe interview questions
- Find Zero Cells in a 2×2 GridRoblox · OARoblox interview questions
- Make Pixel Columns Strictly IncreasingMicrosoft · OAMicrosoft interview questions
- Count Pieces After Othello MovesHudson River Trading · OAHudson River Trading interview questions
- Check Matrix Reflection SymmetryIntuit · OAIntuit interview questions
- Tic-Tac-Toe Board StatusPinecone · OA
- Cherry PickupInfosys · OAInfosys interview questions