7 kyu

Summing a number's digits

17,407 of 41,405mweiss

Description:

Write a function which takes a number as input and returns the sum of the absolute value of each of the number's decimal digits.

For example: (Input --> Output)

10 --> 1
99 --> 18
-32 --> 5

Let's assume that all numbers in the input will be integer values.

Fundamentals

More By Author:

Check out these other kata created by mweiss

Stats:

CreatedFeb 6, 2014
PublishedFeb 6, 2014
Warriors Trained59708
Total Skips5886
Total Code Submissions129196
Total Times Completed41405
JavaScript Completions17407
Ruby Completions2342
Python Completions16066
CoffeeScript Completions170
C# Completions2131
Groovy Completions168
C Completions1510
Julia Completions101
TypeScript Completions1577
Elixir Completions334
Prolog Completions68
Scala Completions50
R Completions92
Lua Completions57
PHP Completions105
Java Completions322
Total Stars343
% of votes with a positive feedback rating93% of 3518
Total "Very Satisfied" Votes3043
Total "Somewhat Satisfied" Votes435
Total "Not Satisfied" Votes40
Ad
Contributors
  • mweiss Avatar
  • jhoffner Avatar
  • user578387 Avatar
  • Unnamed Avatar
  • romerojp Avatar
  • docgunthrop Avatar
  • B1ts Avatar
  • Blind4Basics Avatar
  • Souzooka Avatar
  • rowcased Avatar
  • hobovsky Avatar
  • stellartux Avatar
  • Glyxerine Avatar
  • user8436785 Avatar
  • ejini战神 Avatar
  • KayleighWasTaken Avatar
  • metatable Avatar
  • saudiGuy Avatar
Ad