Didn't guess that "while creating nodes by depth from left to right", it's mean "while creating nodes from up to down (level by level) and left to right".
That tree is not possible according to the kata's requirements.
The tree fills up level by level left to right.
If [17, 0, -4, 3, 15], this is tree
Which array is equivalent to such tree?
Check this out)) Решается довольно просто, но.. Подсказка - используйте в качестве сохранения текущего состояния индексы из массива, ну и проверку на отсутствие чилда как нода.
Typescript 3.3 or above should be enabled
Thx for the answer) I will try another way.
Yes, nested loops (filter has a loop under its hood) is slow for big arrays, try another way.
This comment is hidden because it contains spoiler information about the solution
Can you elaborate more on this, please? I'm getting the same error
Nice kata, thank you!
(JS) Something is broken in basic tests (at least). With a single code return  I get:
expected [ undefined ] to deeply equal 
on first test, on second:
expected [ undefined ] to deeply equal [ 1, 2, 3, 7, 16, 17 ]
Hey can I see the fullUnbalancedTreeShouldNotBePerfect visually? I can't seem to understand the tree.