I’m confused regarding how the space complexity came out to be O(N) when we are not using any auxiliary space to store the recursion stack and instead we are only passing in the same sequence array for each recursion and using sequenceIndex variable to keep track?
Type your question above this line.
Course: https://www.educative.io/collection/5668639101419520/5671464854355968
Lesson: https://www.educative.io/collection/page/5668639101419520/5671464854355968/5750943224168448