about | help | code help+videos | done | prefs |
public int longestLength3(String s1, String s2, String s3)
int len1 = s1.length(); int len2 = s2.length(); int len3 = s3.length(); int longest = len1; // default, assume s1 is longer if (len2 > longest) { // test whether s2 is longer longest = len2; } if (len3 > longest) { // test whether s3 is longer longest = len3; } return longest; longestLength3("1", "12", "123") → 3 longestLength3("012", "0123", "") → 4 longestLength3("hard", "day's", "night") → 5 ...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: 5
Copyright Nick Parlante 2017 - privacy