what will be the answer of n=5 , arr[n]=1, 2, 3, 2, 4
What will be the answer of n=5 , arr[n]=1, 2, 3, 2, 4
for (1,2,3) =10 and for (3,2,4)=10 …total should be 20 but 3 is common in both the subarray…Can you confirm output ?
19 is the correct i have tested with the code as well.
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.