id/email
password
forgot password
about | help | done | prefs | create account
JavaBat java practice problems

String-3 > sameEnds
prev  |  next  |  chance

Given a string, return the longest substring that appears at both the beginning and end of the string without overlapping. For example, sameEnds("abXab") is "ab".

sameEnds("abXYab") → "ab"
sameEnds("xx") → "x"
sameEnds("xxx") → "x"

...Save, Compile, Run

See Also: Example Code Java help: If Boolean Logic | Strings | While and For Loops | Arrays and Loops


prev  |  next  |  chance   |  JavaBat  >  String-3

Forget It! -- delete my code for this problem 321.0

Copyright Nick Parlante 2006-09 - privacy