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

 

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

Write a method that accepts two strings called 'source' and 'target'. The method returns true if it is possible to create the target string by selecting characters from the source string in order. For example canMake("this source","hour") returns true since "this source" can make "hour" by using the capital letters shown here: "tHis sOURce". Note that letters cannot be used out of order, so canMake("snake","ken") returns false. All strings will consist of ONLY lower-case letters.


canMake("zyzmnopq", "zzp") → true
canMake("thiswasfun", "isfn") → true
canMake("thiswasfun", "kdsfljwe") → false

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

public boolean canMake(String source, String target) { }

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

Copyright Nick Parlante 2017 - privacy