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

 

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

Write a method the compares an array of single-character strings 'ltrs' to a single string with multiple characters 'str'. Count how many times the same character appears in the same position in the array and the string. As a precondition you may assume that the length of the array will match the length of the string. Look at the test data for examples.


todays_2021_11_03_APSLHL_match(["a", "k", "i", "l", "l", "e", "r", "r", "a", "b", "b", "i", "t"], "akillerrabbit") → 13
todays_2021_11_03_APSLHL_match(["i", "l", "l", "e", "r", "r", "a", "b", "b", "i", "t", "a", "k"], "akillerrabbit") → 0
todays_2021_11_03_APSLHL_match(["k", "i", "l", "l", "e", "r", "r", "a", "b", "b", "i", "t", "a"], "akillerrabbit") → 3

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

public int todays_2021_11_03_APSLHL_match(String[] ltrs, String str) { }

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

Copyright Nick Parlante 2017 - privacy