Alternating Digit Sum - Practice Coding | SlaveCode
0
0123456789
0
0123456789
:
0
0123456789
0
0123456789
2544. Alternating Digit Sum
Easy
10 Points
Math
You are given a positive integer n. Each digit of n has a sign according to the following rules:
Return the sum of all digits with their corresponding sign.
You are given a positive integer n. Each digit of n has a sign according to the following rules:
Return the sum of all digits with their corresponding sign.