โ† Kotak Mahindra questions

Flatten an array to a given depth

Filed under Kotak Mahindra

The question

Write a function taking an array and depth that flattens nested arrays only to that depth.

No write-up yet. Related questions below have one.

Related Kotak Mahindra questions

Collected from public candidate posts and coding forums. Updated Nov 2026.