leetcode

430. Flatten a Multilevel Doubly Linked List

Iterative Solution

Time complexity: O(n)

Space complexity: O(1)

Recursive Solution

Time complexity: O(n)

Space complexity: O(n)