Exercises/#107 Flatten Nested Array (1 level)
#107

Flatten Nested Array (1 level)

EasyπŸ“¦ Arrays
35 XP

Problem

Given an array that may contain nested arrays (one level deep), flatten it into a single array.

Examples

Input: arr = [1, [2, 3], [4, 5], 6]
Output: [1, 2, 3, 4, 5, 6]
array
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

107 / 150

Your Solution

⚑ JavaScript

to save progress and use AI features