Write a function to flatten a deeply nested list (with arbitrary levels of nesting).
HardProblem Statement
Write a function to flatten a deeply nested list (with arbitrary levels of nesting).
Sample Input
[[1, [2, [3, [4]], 5]]]
Sample Output
[1, 2, 3, 4, 5]
Limits
Time: 2s · Memory: 256 MB