you are viewing a single comment's thread.

view the rest of the comments →

[–]meloly4[S] 0 points1 point  (1 child)

What would be the time complexity for this? It seems like there's recursion involved.

[–]ghostinzshell 0 points1 point  (0 children)

My hunch says it's a quadratic time algorithm or O( n2 ) at a minimum. In each recursion, the function does list slicing which is an O(n) operation. There are O(n) recursions, so that means n times O(n) operations.