The test suite already spoils the solution.
True. In general that should be avoided, although admittedly it's difficult here because if the correct answer were hard-coded, then changes to: (i) the hardware on which Cody runs; or (ii) the version of MATLAB that Cody employs may eventually invalidate it. Having said that, the Test Suite could still be tightened up (see e.g. Solution 1461085).
Sum all integers from 1 to 2^n
8419 Solvers
Make one big string out of two smaller strings
1149 Solvers
Solve the set of simultaneous linear equations
273 Solvers
Relative ratio of "1" in binary number
392 Solvers
Element by element multiplication of two vectors
268 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!