Back
Close

Sum or Diff

Statement

 Goal

Does a reverse clash needs to be documented ?

Take the ASCII code of the char and substract or add its following number depending on if number is odd or even

Number is Even: Add
Number is Odd: Substract
Input
input as String
Output
value as integer
Constraints
input contains 1 Char and 1 or more Digits
Example
Input
A1
Output
64

Game modes
Reverse

Test cases
Test 1 Test
Input
A1
Output
64

Validator 1 Validator
Input
G3
Output
68

Test 2 Test
Input
F4
Output
74

Validator 2 Validator
Input
J2
Output
76

Test 3 Test
Input
q39
Output
74

Validator 3 Validator
Input
n17
Output
93

Test 4 Test
Input
t8
Output
124

Validator 4 Validator
Input
p6
Output
118

Test 5 Test
Input
(869
Output
-829

Validator 5 Validator
Input
)567
Output
-526

Test 6 Test
Input
%8988
Output
9025

Validator 6 Validator
Input
$5684
Output
5720

Solution language

Solution

Stub generator input