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

 

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

Given two strings, return the positive difference in the length of the two strings. We will call this the lenDiff. For example the lenDiff between "whatcha doin" and "sup" is 9 because the longer string has nine MORE characters than the shorter one. The strings will be given in any order of length.


lenDiff("testing", "testing") → 0
lenDiff("hello", "goodbye") → 2
lenDiff("go", "much faster") → 9

...Save, Compile, Run (ctrl-enter)

public int lenDiff(String str1, String str2) { }

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: 300

Copyright Nick Parlante 2017 - privacy