Given a string `s` of uppercase letters, your task is to determine how many strings `t` (also uppercase) with length equal to that of `s` satisfy the followng conditions:
* `t` is lexicographical larger than `s`, and
* when you write both `s` and `t` in reverse order, `t` is still lexicographical larger than `s`.
```Haskell
For example:
solve('XYZ') = 5. They are: YYZ, ZYZ, XZZ, YZZ, ZZZ
```
String lengths are less than `5000`. Return you answer `modulo 10^9+7 (= 1000000007)`.
More examples in test cases. Good luck!
def solve(s):
    greater_letters = list(map(lambda x: 90 - ord(x), s))
    sum_value, tmp = 0, 0
    for value in greater_letters:
        sum_value += value*(1+tmp)
        tmp = (26*tmp + value) % 1000000007
    return sum_value % 1000000007
def solve(s):
    greater_letters = list(map(lambda x: 90 - ord(x), s))
    sum_value, tmp = 0, 0
    for value in greater_letters:
        sum_value += value*(1+tmp)
        tmp = (26*tmp + value) % 1000000007
    return sum_value % 1000000007