Maximum alternating subsequence sum

My recursive code worked and when I memorized it it started giving me wrong result plzzz help me to fix my code will really appreciate the help
problem https://leetcode.com/problems/maximum-alternating-subsequence-sum/

my code https://ide.codingblocks.com/s/579992

Thanks in advance

Hi Sanjay. Kindly ask doubts from within the course contents only or from hacker blocks

well a doubt is doubt . What if I learn something which is incorrect not pointing out lectures are really good but it’s my responsibility to double check what u teaches applies everywhere by practicing or not and I asked 100+ doubts from Leetcode neverever any TA refused and I thanks them very much . At the end doubt is a doubt well I have solved this question it was some slight mistake but thankyou for responding I will close this doubt !!!

I understand that a doubt is a doubt. but u also understand that at the end we have to put some boundaries. the no of questions available are countless say it be from leetcode, gfg, codechef, codeforces

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.

Brother I have already completed this course earlier C++ one but I purchased it again bcz being from tier 3 college there is nobody whom I can reach to ask my doubts ! I just bought this course once again so that I can have a reflection of mentor at some point when I get stuck when I waste my complete day on silly doubt a mentor or TA experienced person can help me in just seconds so You won’t understands what this support means to me so plz don’t set these boundaries on basis of your choices. Sorry if I sound rude but its truth I have just one door for this and I won’t let anyone close it !!