← HALL

Off-By-One Array Bound

EASY
+100 XP REWARD ⏱ Limit: 5m
// MISSION BRIEFING //

ANOMALY DESCRIPTION

An array summation utility is throwing undefined errors or NaN because its loop boundary traverses past the final index. Fix the loop guard to properly sum array elements without indexing out of bounds.

SPECIFICATION SUITE

Sum positive integers
Input: [1, 2, 3, 4]
Expected: 10
Sum single element
Input: [42]
Expected: 42
Sum empty array [PROTECTED TEST]
Evaluation logic hidden to prevent hardcoding.

RADAR HINTS

Hint #1 (Click to decrypt)

Inspect the loop termination condition. What index does the final iteration evaluate?

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

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