about | help | code help+videos | done | prefs |
The "span" of a number is the difference between the greatest digit and the smallest digit in the decimal representation of that number. Given a non-negative input parameter, return the "span" of that number. For example, 84294 has a span of 7 because 9 is the largest digit and 2 is the smallest digit and 9-2=7. Note that any single-digit number has a span of 0 and any number consisting of all the same digits also has a span of 0 (for example 55555 has a span of 0). retestQuiz05272014Span(1289721) → 8 retestQuiz05272014Span(2924004) → 9 retestQuiz05272014Span(21243) → 3 ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 220
Copyright Nick Parlante 2017 - privacy