+ 2
Sub Array With Given Sum
Hey !! I just created a code on the above question .. I run it through some test cases its working. .but I am not sure .if its exactly right or not ... So would anyone please help me figure out this one ? The Problem description is inside the code and every suggestion is Welcomed https://code.sololearn.com/cSOqHq87kxf1/?ref=app
2 odpowiedzi
+ 1
Line 19: You forgot to put n on the statment. It should be this:
cout << n << endl;
Line 26: same thing but with sum.
cout << sum << endl;
Line 34: the same thing but with array.
cout << array << endl;
And Line 54: break is used with switch statements and not with the if statements.
So you should remove it.
0
Lebi Actually those cout<<endl; are forcefully written by me to make my output look good instead of in one line
and the break in line 54 is to break the loop when that condition is met ..