Haskell! Uses the TupleSections extension to the compiler to make the pairs function nicer.
{-# LANGUAGE TupleSections #-}importData.Char(digitToInt)digits::Int->[Int]digits=mapdigitToInt.showpairs::[a]->[(a,a)]pairs(x:[])=[]pairs(x:xs)=map(x,)xs++pairsxsallSums::Int->[Int]allSums=map(uncurry(+)).pairs.digits
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Haskell! Uses the
TupleSections
extension to the compiler to make thepairs
function nicer.