Simple arithmetic:
return 7 - input + 5;
(which can be simplified as return 12 - input;)
Let’s say the input is 7:
return 7 – 7 + 5 –> return 5
Or if the input is 5:
return 7 – 5 + 5 –> return 7
Simple arithmetic:
return 7 - input + 5;
(which can be simplified as return 12 - input;)
Let’s say the input is 7:
return 7 – 7 + 5 –> return 5
Or if the input is 5:
return 7 – 5 + 5 –> return 7