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


String-2 > xyzMiddle
prev  |  next  |  chance

Given a string, does "xyz" appear in the middle of the string? To define middle, we'll say that the number of chars to the left and right of the "xyz" must differ by at most one. This problem is harder than it looks.

xyzMiddle("AAxyzBB") → true
xyzMiddle("AxyzBB") → true
xyzMiddle("AxyzBBB") → false

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

public boolean xyzMiddle(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: 242.0

Copyright Nick Parlante 2017 - privacy