Reverse Gear

The numbers are given in a string and separated  by a white space..first reverse the numbers and add all together. At last print the reverse number of the final sum..Note: reverse number of 20 --> 2, 150 --> 51, -23 -- >-32

IN

12 12 10 -10 -24

OUT

0

IN

-10 10 -20 40

OUT

2

IN

12 -100 100 -150

OUT

-13

Last test: 12 -100 100 -150

should be: 21 - 1 +1 -51 = -30, which gives -3 when reversed, not -13

The test is incorrect.

Sat Feb 14 13:37:47 2015

It seems @vakorol is right - the last test is not correct.

Thu Feb 19 18:16:40 2015


Leave a comment

Parsed as Markdown

Login to leave a comment