Applaunch Interview Question

Flatten an array with nested children upto 3 level