Answers to Coding Bat's Array-3 Problems, all detailed and explained.
maxSpan | fix34 | fix45 |
canBalance | linearIn | squareUp |
seriesUp | maxMirror | countClumps |

prev | next | chance
ReplyDeleteGiven a string, return true if "bad" appears starting at index 0 or 1 in the string, such as with "badxxx" or "xbadxx" but not "xxbadxx". The string may be any length, including 0. Note: use .equals() to compare 2 strings.
hasBad("badxx") → true
hasBad("xbadxx") → true
hasBad("xxbadxx") → false
Go...Save, Compile, Run (ctrl-enter)
public boolean hasBad(String str) {
if st>r
}