How to solve this question Q3

can you show how it is O(N^2) the recurence relation and the calculation

Assuming vector is defined as vector< int > v
its time complexity will be O(n^2).
because total n calls will be there and on every call vector get copied to new vector which is O(n) for each call . therefore O(n^2) for n calls

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.