The second test is wrong. 4 is not < 1.
The example seems to be wrong as well. The output should be 9 (as stated in test 1 which uses the same vector), not 7.
thanks Sean and Jon for comment on problem, I have corrected the same.
this is a test case specific solution and would not work if change the test cases.
Back to basics 12 - Input Arguments
527 Solvers
Back to basics 25 - Valid variable names
295 Solvers
Change the sign of even index entries of the reversed vector
305 Solvers
Find out value of sine given by degree.
236 Solvers
find the surface area of a cube
345 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!