Sum and multiply it !
Statement
Goal
Given a string S, you should calculate an integer R which is the result of summing all S's digits except the first one, and then multiplying the result with the first digit.if S is not an integer print
NOTES:
- Be careful, the first number may be negative (starting with '
- Strings starting with '
Example:
S(Input)=123
R(Output)=1*(2+3)=5
Input
String S
Output
The result R
if the input is not a number printINVALID
if the input is not a number print
Constraints
-100000<R<100000
Example
Input
123
Output
5
Game modes
Fastest
Test cases
Positive number Test
Input
123
Output
5
Positive number Validator
Input
321
Output
9
Short Test
Input
12
Output
2
Short validator Validator
Input
23
Output
6
Negative number Test
Input
-593
Output
-60
Negative number Validator
Input
-511
Output
-10
Non-digit input Test
Input
156LM965
Output
INVALID
Non-digit input Validator
Input
12RF5
Output
INVALID
Starting with zero Test
Input
012
Output
0
Starting with zero Validator
Input
0125656768
Output
0
Sum it all Test
Input
1123456789
Output
45
Sum it all Validator
Input
-1123456789
Output
-45
Test 7 Test
Input
123-13
Output
INVALID
Validator 7 Validator
Input
324-3-324
Output
INVALID
Solution language
Solution
Stub generator input