Search
⌘K

Leetcode 2775. Undefined to Null

Given a nested JavaScript-like data structure of objects and arrays that may contain undefined values, transform it so every undefined is replaced with null while preserving the original structure and other values. This requires a recursive traversal (distinguishing arrays vs objects) and careful handling to avoid modifying unintended references or mishandling nested collections.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.