forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice lasa_drills_01 > LASA_borderDigits
prev  |  next  |  chance

Provided two arguments, seq (a sequence of digits 0-9) and sub (a sub-sequence of digits 0-9), return a new sequence containing every digit, in order, that comes immediately before or after every appearance of sub in seq. If a digit is shared by two appearances, it should be included twice in the output. Appearances may be at the beginning and/or end of seq, in which case only existing digits should be included. Assume that sub.length() > 0 and that there are no overlapping appearances.

LASA_borderDigits("12345", "34") → "25"
LASA_borderDigits("05675670", "567") → "0570"
LASA_borderDigits("12121", "1") → "2222"

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

public String LASA_borderDigits(String seq, String sub) { }

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

Post-solution available

Copyright Nick Parlante 2017 - privacy