Exercises/#122 Spiral Matrix
#122

Spiral Matrix

MediumπŸ“¦ Arrays
85 XP

Problem

Given an mΓ—n matrix, return all elements in spiral order.

Examples

Input: [[1,2,3],[4,5,6],[7,8,9]]
Output: [1,2,3,6,9,8,7,4,5]
arraymatrixsimulation
AI Assistantβ€” powered by AI

Unlock hints progressively β€” start gentle, go deeper only if needed.

πŸ’‘

Level 1: Gentle Nudge

A subtle direction

πŸ—ΊοΈ

Level 2: Approach

The algorithm to use

πŸ”

Level 3: Detailed

Step-by-step guidance

122 / 150

Your Solution

⚑ JavaScript

to save progress and use AI features