You are given a list nums of integers, which may be negative.
Return a new list in which each integer is replaced by the sum of its digits. The sign is ignored, so -99 becomes 9 + 9 = 18. The result list has the same length and order as the input.
NOTE: This is a function-type question — you only write the function. Do not read input or print anything; a hidden checker calls your function and checks its return value.
Arguments
[123, 45, 6]
Returns
[6, 9, 6]