Kuddos to the time and effort you're putting in making the playlist of such complex topics...each and every video of yours has helped me at some point of time... i really appreciate your efforts
bhaiya sach me aap mast padhate ho..mai already medium level recursion bana leta tha lekin feel nhi aata tha ke kaise ho rha hai..apka video dekh ke ab feel aa rha hai kaise hota hai..thanks
i cant explain my happiness that my youtube favorate teacher is going to explain DP... thanks you so much bhaiyaa. there is one more suggestion that bhaiya pliz start one more topics parallely like backtracking, trie or any DAA topics because our placement is so near so that 3rd year students got a time to revision and question practice also.........
another recursive solution:- int ans = 0; void solve(vector &arr, int op){ if(arr.size() == 0){ ans = op; return; } int op1 = op; op1 = max(op1, arr[0]); arr.erase(arr.begin()+ 0); solve(arr, op1); return; } int largest(vector &arr, int n) { int op = INT_MIN; solve(arr, op); return ans; }