Problem Statement
We call a pair of
Given
Definition
- Class:
- IdentifyingWood
- Method:
- check
- Parameters:
- String, String
- Returns:
- String
- Method signature:
- String check(String s, String t)
- (be sure your method is public)
Notes
- String t is contained in string s as a subsequence if we can obtain t by removing zero or more (not necessarily consecutive) characters from s.
Constraints
- s and t will consist only of lowercase English letters.
- s and t will each be between 1 and 10 characters long, inclusive.
Examples
"absdefgh"
"asdf"
Returns: "Yep, it's wood."
"oxoxoxox"
"ooxxoo"
Returns: "Nope."
"oxoxoxox"
"xxx"
Returns: "Yep, it's wood."
"qwerty"
"qwerty"
Returns: "Yep, it's wood."
"string"
"longstring"
Returns: "Nope."
"oxoxoxoxo"
"ooxxoo"
Returns: "Yep, it's wood."
"oxoxoxoxo"
"ooooo"
Returns: "Yep, it's wood."
"oxoxoxoxo"
"oooooo"
Returns: "Nope."
"z"
"z"
Returns: "Yep, it's wood."
"z"
"x"
Returns: "Nope."
"q"
"qq"
Returns: "Nope."
"abcdefgh"
"hgfedcba"
Returns: "Nope."
"uti"
"i"
Returns: "Yep, it's wood."
"uti"
"u"
Returns: "Yep, it's wood."
"uti"
"t"
Returns: "Yep, it's wood."
"uti"
"ut"
Returns: "Yep, it's wood."
"uti"
"ui"
Returns: "Yep, it's wood."
"uti"
"ti"
Returns: "Yep, it's wood."
"uti"
"it"
Returns: "Nope."
"uti"
"ttttt"
Returns: "Nope."
"isnsduupn"
"isnuupn"
Returns: "Yep, it's wood."
"atkown"
"ao"
Returns: "Yep, it's wood."
"qaytakqzp"
"qaaqp"
Returns: "Yep, it's wood."
"gmgajgebqv"
"gmagqv"
Returns: "Yep, it's wood."
"vhhegznh"
"vhhegzph"
Returns: "Nope."
"qmvotko"
"qempvotko"
Returns: "Nope."
"zpkpsaus"
"zs"
Returns: "Yep, it's wood."
"ukaovhzydz"
"uhzdz"
Returns: "Yep, it's wood."
"ukaovhzydz"
"ukaovhzydz"
Returns: "Yep, it's wood."
"ukaovhzydz"
"u"
Returns: "Yep, it's wood."
"ukaovhzydz"
"z"
Returns: "Yep, it's wood."
"ukaovhzydz"
"a"
Returns: "Yep, it's wood."
"ukaovhzydz"
"ukaovhyd"
Returns: "Yep, it's wood."
"ukaovhzydz"
"kaovhzydz"
Returns: "Yep, it's wood."
"aaaaaaaaaa"
"aaaaaaaaaa"
Returns: "Yep, it's wood."
"bbbbbbbbb"
"bbbbbbbbbb"
Returns: "Nope."
"cccccccccc"
"ccccccccc"
Returns: "Yep, it's wood."
"dmlefgxway"
"mlgway"
Returns: "Yep, it's wood."
"amaafaaway"
"mfwy"
Returns: "Yep, it's wood."
"kgvfonbjj"
"phucvaxwrr"
Returns: "Nope."
"okezehtnop"
"lnapspchuy"
Returns: "Nope."
"aaba"
"baa"
Returns: "Nope."
"yhspp"
"hpy"
Returns: "Nope."
"zpkpzaus"
"zpzp"
Returns: "Nope."
"zpkpzaus"
"zppzs"
Returns: "Yep, it's wood."
"zpkpzaus"
"zppzk"
Returns: "Nope."
"zpkpzaus"
"zpkszaup"
Returns: "Nope."
"zabycxdwev"
"zabycxdwve"
Returns: "Nope."
"zabycxdwev"
"abycxdwev"
Returns: "Yep, it's wood."
"zabycxdwev"
"azbycxdwev"
Returns: "Nope."
"a"
"b"
Returns: "Nope."
"aab"
"ba"
Returns: "Nope."
"abcdefgh"
"fed"
Returns: "Nope."
"axb"
"ab"
Returns: "Yep, it's wood."
"oxoxo"
"oox"
Returns: "Yep, it's wood."
"qsdqsd"
"dqq"
Returns: "Nope."
"bac"
"abc"
Returns: "Nope."
"abcdabcd"
"accd"
Returns: "Yep, it's wood."
"ab"
"b"
Returns: "Yep, it's wood."
"badtoed"
"bbbbbbb"
Returns: "Nope."
"abcd"
"w"
Returns: "Nope."
"abcd"
"ab"
Returns: "Yep, it's wood."
"asdfghjkl"
"adgj"
Returns: "Yep, it's wood."
"yyxx"
"xxyy"
Returns: "Nope."
"aaa"
"ab"
Returns: "Nope."
"string"
"sidg"
Returns: "Nope."
"tesat"
"test"
Returns: "Yep, it's wood."
"oxoxoxoxab"
"xxax"
Returns: "Nope."
"abcdef"
"aac"
Returns: "Nope."
"badc"
"bcd"
Returns: "Nope."
"asdf"
"wqre"
Returns: "Nope."
"abcdef"
"adce"
Returns: "Nope."
"aaa"
"aa"
Returns: "Yep, it's wood."
"abcd"
"t"
Returns: "Nope."
"abba"
"aab"
Returns: "Nope."
"aab"
"aba"
Returns: "Nope."
"abc"
"abc"
Returns: "Yep, it's wood."
"sop"
"ss"
Returns: "Nope."
"abcdefgh"
"bdfh"
Returns: "Yep, it's wood."
"oo"
"ox"
Returns: "Nope."