Unidentifiederror in code

my code is not showing correct order of arrray for which max sum is possible

these are the two mistakes

correct one

1)
 left=i;
 right=j;

2) 
for(int i=left;i<=right;i++){
	cout<<a[i]<<",";
}
you have to print from left to right not from 0 to left

i hope this helps
if yes hit a like and don’t forgot to mark doubt as resolved :grinning:
if you have more doubts regarding this feel free to ask

1 Like