You are given a positive integer n. Each digit of n is assigned a sign that alternates between positive and negative:
The most significant digit is assigned a positive sign.
Each subsequent digit is assigned a sign opposite to the digit preceding it.
Return the sum of all digits with their corresponding signs applied.
Constraints:
n
You are given a positive integer n. Each digit of n is assigned a sign that alternates between positive and negative:
The most significant digit is assigned a positive sign.
Each subsequent digit is assigned a sign opposite to the digit preceding it.
Return the sum of all digits with their corresponding signs applied.
Constraints:
n