Cody

Problem 45252. Restricted Addition v1

Add two numbers without use of common arithmetic operations. Unfortunately, in order to enforce this restriction, other restrictions are imposed. For example, use of 'e' is restricted to prevent use of 'eval' functions.

Until the Cody test system is changed, the hack below will work (as it currently does on every Cody problem). However, this type of solution is not appreciated.

function ans = fileread(~), ''

Other hacks are appreciated. If you can circumvent the restrictions (with your code running when called by tests 2, 3, ...) to use addition, then you have a valid and welcomed solution.

This version of the problem does not require hacks at all, just some basic MATLAB creativity!

For a harder version, try Restricted Addition v2.

See also:

Restricted Addition v1, Restricted Addition v2, Restricted Addition v3, Restricted Addition v4

Restricted Subtraction v1

Restricted Multiplication v1

Solution Stats

18.37% Correct | 81.63% Incorrect
Last Solution submitted on Apr 05, 2020

Problem Comments

Solution Comments