loading...

re: LeetCode in Ruby: 102. Binary Tree Level Order Traversal VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Can you explain me the following code? Mainly the <<... #RubyNewbie here result << [] if result.length == level
 

It means that just before we begin to store the values of the next level, we add an empty array that will be used to store the values.

Code of Conduct Report abuse