https://leetcode.com/problems/alternating-digit-sum/


I think my answer is right. The test case is wrong.

A special case is 26, the test case answer is -4

But according to the `most significant digit is positive`, I think the answer should be -2 + 6 = 4


```python
import math

class Solution:
    def get_alternating_sum(self, list_):
        sign = 1
        sum_ = 0
        for i in list_:
            if sign == -1:
                sign = 1
            else:
                sign = -1
            sum_ += sign * i
        return sum_

    def alternateDigitSum(self, n: int) -> int:
        #2023/2/7 07:28
        digits = []
        the_max_value = -math.inf
        the_max_value_index = -1
        for index, i in enumerate(str(n)):
            i = int(i)
            if i > the_max_value:
                the_max_value = i
                the_max_value_index = index
            digits.append(i)
        
        if len(digits) == 1:
            return digits[0]
        if len(digits) == 2:
            return max(digits) + -min(digits)
        
        part1 = list(reversed(digits[:the_max_value_index]))
        part2 = digits[the_max_value_index+1:]
        return self.get_alternating_sum(part1) + self.get_alternating_sum(part2) + digits[the_max_value_index]
        #2023/2/7 07:44
```
