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

 

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

Write a method that evaluates the "front-back" symmetry of a string up to matchLen letters from the front and back of the string. Return 'true' if the string is symmetric up to matchLen letters. Return false if matchLen is greater than half the string length, or if the letters don't match. For example, the string "racecar" will return true with a matchLen of 0, 1, 2, or 3, but not higher because a higher matchLen would be more than half the length of the string.


nov9_2015_SLHL_matchMany("racecar", 3) → true
nov9_2015_SLHL_matchMany("amanaplanacanalpanama", 5) → true
nov9_2015_SLHL_matchMany("amanaplanacanalpanama", 15) → false

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

public boolean nov9_2015_SLHL_matchMany(String str, int matchLen) { }

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

Copyright Nick Parlante 2017 - privacy