7 kyu

Summing a number's digits

17,256 of 40,873mweiss

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 Trained59045
Total Skips5859
Total Code Submissions127959
Total Times Completed40873
JavaScript Completions17256
Ruby Completions2335
Python Completions15845
CoffeeScript Completions170
C# Completions2112
Groovy Completions167
C Completions1499
Julia Completions99
TypeScript Completions1548
Elixir Completions332
Prolog Completions66
Scala Completions49
R Completions87
Lua Completions54
PHP Completions78
Java Completions250
Total Stars341
% of votes with a positive feedback rating93% of 3499
Total "Very Satisfied" Votes3025
Total "Somewhat Satisfied" Votes434
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