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

 

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

Two strings will be passed in. Either string may be longer than the other one, or they could both be the same length. Return the difference in their lengths. For example, if the first string has 20 characters, but the second string has 27 characters, return 7 because that is the difference in their lengths.


nov9_2015_APSLHL_longerBy("adslkfjdwei", "afdas") → 6
nov9_2015_APSLHL_longerBy("", "xyz") → 3
nov9_2015_APSLHL_longerBy("short", "much longer string") → 13

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

public int nov9_2015_APSLHL_longerBy(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: 290

Copyright Nick Parlante 2017 - privacy