-1 byte by porting Jenny_mathy's Mathematic answer.
-2 more bytes by better golfing :p
;SN$DFS:9
See the test suite.
How?
;SN$DFS:9 - Main link: list of numbers, [a,b] e.g. [348,53]
$ - last two links as a monad
S - sum 401
N - negate -401
; - concatenate [348,53,-401]
D - convert to decimal lists [[3,4,8],[5,3],[-4,0,-1]]
F - flatten [3,4,8,5,3,-4,0,-1]
S - sum 18
:9 - integer divide by nine 2
My 12 byte solution...
:⁵+
DUSç\>9S
A monadic link taking a pair of integers and returning the number of carries as an integer.
There is probably a shorter way though! There was!
Try it online! or see the test suite.
How
:⁵+ · Link 1: perform a carry: right-column's-digit-sum, a; left-colum's-digit-sum; b
⁵ · literal 10
: · a integer-divided by 10 - the carry amount
+ · add to b
DUSç\>9S · Main link: list of summands e.g. [348,52]
D · convert to decimal lists [[3,4,8],[5,2]]
U · upend (reverse each) [[8,4,3],[2,5]]
S · sum (add the digits up) [10,9,3]
\ · cumulative reduce with:
ç · last link (1) as a dyad [10,10,4]
9 · literal 9
> · greater than? [ 1, 1,0]
S · sum 2
190192, 90909
(has a break in the carries). \$\endgroup\$9+9
gives you18
, but the digit sum is9+9-10+1
because there is a carry. \$\endgroup\$repr
appending anL
for numbers above2**63-1
? \$\endgroup\$