Need help in the problem: Christmas Spruce.

Revision en3, by absy, 2021-06-15 21:23:42

913B - Christmas Spruce

119557653

Basically, I create a nested list where I store each node's child vertexes in different elements(eg: indexes of the child vertexes of the root node are in the 0th element/ the first element) of the list. Then, I remove the index of the child vertex (if that child vertex has further children) from the element associated with the parent vertex.

For eg: if 1 had 3 children, 2 3 and 4, and if 2 had further children, then we remove 2 from the element associated with the root, i.e. the 0th element in the list.

so before change -> [[2,3,4],[5,6,7]] after change -> [[3,4],[5,6,7]]

I'd appreciate the help especially since I'm a noob at coding :)

Tags #help, #newbie

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en4 English absy 2021-06-16 11:46:39 343
en3 English absy 2021-06-15 21:23:42 695
en2 English absy 2021-06-15 21:06:16 5 Tiny change: 'blem:913B][submissio' -> 'blem:913B]\n\n[submissio'
en1 English absy 2021-06-15 21:05:33 421 Initial revision (published)