id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

jebbert@volusia.k12.fl.us > retestQuiz05272014Span
prev  |  next  |  chance

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)

public int retestQuiz05272014Span(int num) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 220

Copyright Nick Parlante 2017 - privacy