about | help | code help+videos | done | prefs |
Write a method that accepts two input parameter strings. The first string will be equal in length to the second string or it will be shorter than the second string. Return how many characters match in the same position in both strings. For example, "two" and "twenty" have two matches since the same characters appear in both of the first two spaces. In the case of "abcde" and "bcdea", there are zero matches because none of the characters match in the same position. The only string methods you are allowed to use are .length, .substring, .charAt, and .equals. dec1_2017_APSLHL_countMatches("car", "bar") → 2 dec1_2017_APSLHL_countMatches("jump", "jeep") → 2 dec1_2017_APSLHL_countMatches("summer", "winter and spring") → 2 ...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: 270
Copyright Nick Parlante 2017 - privacy