educative.io

Topdown Solution Missing Space + Time Complexity?

I believe it’s Time = N^2 and Space = N (as that’s the maximum stack depth) but could be wrong.