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

 

mrsdianneoc@gmail.com > countSameStart
prev  |  next  |  chance

Given 2 arrays that are the same length containing strings, compare the 1st string in one array to the 1st string in the other array, the 2nd to the 2nd and so on. Count the number of times that the 2 strings start with the same char. All strings have at least 1 character. There is at least 1 string in each array.


countSameStart(["aa", "bb", "cc"], ["aaa", "xx", "bb"]) → 1
countSameStart(["aa", "bb", "cc"], ["aaa", "blab", "bob"]) → 2
countSameStart(["aa", "bb", "cc"], ["fg", "pop", "ccc"]) → 1

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

int countSameStart(String[] a, String[] b){ }

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 Post-solution available

Copyright Nick Parlante 2017 - privacy