← HALL

Flatten Array Depth Recursion

MEDIUM
+250 XP REWARD ⏱ Limit: 10m
// MISSION BRIEFING //

ANOMALY DESCRIPTION

A packet flattener only flattens 1 level deep using [].concat(...arr). Nested packets deeper than 1 level remain unflattened. Implement recursive flattening or use flat(Infinity).

SPECIFICATION SUITE

Nested 2 levels
Input: [1, [2, [3, 4]]]
Expected: [1, 2, 3, 4]
Flat array untouched
Input: [1, 2, 3]
Expected: [1, 2, 3]
Deeply nested [PROTECTED TEST]
Evaluation logic hidden to prevent hardcoding.

RADAR HINTS

Hint #1 (Click to decrypt)

Use the modern arr.flat(Infinity) method.

solution.js UTF-8 • JAVASCRIPT
STATIC ANALYSIS CONSOLE Ready for dispatch

Press "VERIFY & SUBMIT" or Ctrl+Enter to evaluate your patch.