Statistics

Problem Statement for "IdentifyingWood"

Problem Statement

We call a pair of Strings (s, t) "wood" if t is contained in s as a subsequence. (See Notes for a formal definition.)


Given Strings s and t, return the String "Yep, it's wood." (quotes for clarity) if the pair (s, t) is wood and "Nope." otherwise.

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

  1. "absdefgh"

    "asdf"

    Returns: "Yep, it's wood."

  2. "oxoxoxox"

    "ooxxoo"

    Returns: "Nope."

  3. "oxoxoxox"

    "xxx"

    Returns: "Yep, it's wood."

  4. "qwerty"

    "qwerty"

    Returns: "Yep, it's wood."

  5. "string"

    "longstring"

    Returns: "Nope."

  6. "oxoxoxoxo"

    "ooxxoo"

    Returns: "Yep, it's wood."

  7. "oxoxoxoxo"

    "ooooo"

    Returns: "Yep, it's wood."

  8. "oxoxoxoxo"

    "oooooo"

    Returns: "Nope."

  9. "z"

    "z"

    Returns: "Yep, it's wood."

  10. "z"

    "x"

    Returns: "Nope."

  11. "q"

    "qq"

    Returns: "Nope."

  12. "abcdefgh"

    "hgfedcba"

    Returns: "Nope."

  13. "uti"

    "i"

    Returns: "Yep, it's wood."

  14. "uti"

    "u"

    Returns: "Yep, it's wood."

  15. "uti"

    "t"

    Returns: "Yep, it's wood."

  16. "uti"

    "ut"

    Returns: "Yep, it's wood."

  17. "uti"

    "ui"

    Returns: "Yep, it's wood."

  18. "uti"

    "ti"

    Returns: "Yep, it's wood."

  19. "uti"

    "it"

    Returns: "Nope."

  20. "uti"

    "ttttt"

    Returns: "Nope."

  21. "isnsduupn"

    "isnuupn"

    Returns: "Yep, it's wood."

  22. "atkown"

    "ao"

    Returns: "Yep, it's wood."

  23. "qaytakqzp"

    "qaaqp"

    Returns: "Yep, it's wood."

  24. "gmgajgebqv"

    "gmagqv"

    Returns: "Yep, it's wood."

  25. "vhhegznh"

    "vhhegzph"

    Returns: "Nope."

  26. "qmvotko"

    "qempvotko"

    Returns: "Nope."

  27. "zpkpsaus"

    "zs"

    Returns: "Yep, it's wood."

  28. "ukaovhzydz"

    "uhzdz"

    Returns: "Yep, it's wood."

  29. "ukaovhzydz"

    "ukaovhzydz"

    Returns: "Yep, it's wood."

  30. "ukaovhzydz"

    "u"

    Returns: "Yep, it's wood."

  31. "ukaovhzydz"

    "z"

    Returns: "Yep, it's wood."

  32. "ukaovhzydz"

    "a"

    Returns: "Yep, it's wood."

  33. "ukaovhzydz"

    "ukaovhyd"

    Returns: "Yep, it's wood."

  34. "ukaovhzydz"

    "kaovhzydz"

    Returns: "Yep, it's wood."

  35. "aaaaaaaaaa"

    "aaaaaaaaaa"

    Returns: "Yep, it's wood."

  36. "bbbbbbbbb"

    "bbbbbbbbbb"

    Returns: "Nope."

  37. "cccccccccc"

    "ccccccccc"

    Returns: "Yep, it's wood."

  38. "dmlefgxway"

    "mlgway"

    Returns: "Yep, it's wood."

  39. "amaafaaway"

    "mfwy"

    Returns: "Yep, it's wood."

  40. "kgvfonbjj"

    "phucvaxwrr"

    Returns: "Nope."

  41. "okezehtnop"

    "lnapspchuy"

    Returns: "Nope."

  42. "aaba"

    "baa"

    Returns: "Nope."

  43. "yhspp"

    "hpy"

    Returns: "Nope."

  44. "zpkpzaus"

    "zpzp"

    Returns: "Nope."

  45. "zpkpzaus"

    "zppzs"

    Returns: "Yep, it's wood."

  46. "zpkpzaus"

    "zppzk"

    Returns: "Nope."

  47. "zpkpzaus"

    "zpkszaup"

    Returns: "Nope."

  48. "zabycxdwev"

    "zabycxdwve"

    Returns: "Nope."

  49. "zabycxdwev"

    "abycxdwev"

    Returns: "Yep, it's wood."

  50. "zabycxdwev"

    "azbycxdwev"

    Returns: "Nope."

  51. "a"

    "b"

    Returns: "Nope."

  52. "aab"

    "ba"

    Returns: "Nope."

  53. "abcdefgh"

    "fed"

    Returns: "Nope."

  54. "axb"

    "ab"

    Returns: "Yep, it's wood."

  55. "oxoxo"

    "oox"

    Returns: "Yep, it's wood."

  56. "qsdqsd"

    "dqq"

    Returns: "Nope."

  57. "bac"

    "abc"

    Returns: "Nope."

  58. "abcdabcd"

    "accd"

    Returns: "Yep, it's wood."

  59. "ab"

    "b"

    Returns: "Yep, it's wood."

  60. "badtoed"

    "bbbbbbb"

    Returns: "Nope."

  61. "abcd"

    "w"

    Returns: "Nope."

  62. "abcd"

    "ab"

    Returns: "Yep, it's wood."

  63. "asdfghjkl"

    "adgj"

    Returns: "Yep, it's wood."

  64. "yyxx"

    "xxyy"

    Returns: "Nope."

  65. "aaa"

    "ab"

    Returns: "Nope."

  66. "string"

    "sidg"

    Returns: "Nope."

  67. "tesat"

    "test"

    Returns: "Yep, it's wood."

  68. "oxoxoxoxab"

    "xxax"

    Returns: "Nope."

  69. "abcdef"

    "aac"

    Returns: "Nope."

  70. "badc"

    "bcd"

    Returns: "Nope."

  71. "asdf"

    "wqre"

    Returns: "Nope."

  72. "abcdef"

    "adce"

    Returns: "Nope."

  73. "aaa"

    "aa"

    Returns: "Yep, it's wood."

  74. "abcd"

    "t"

    Returns: "Nope."

  75. "abba"

    "aab"

    Returns: "Nope."

  76. "aab"

    "aba"

    Returns: "Nope."

  77. "abc"

    "abc"

    Returns: "Yep, it's wood."

  78. "sop"

    "ss"

    Returns: "Nope."

  79. "abcdefgh"

    "bdfh"

    Returns: "Yep, it's wood."

  80. "oo"

    "ox"

    Returns: "Nope."


This problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly prohibited. (c)2024, TopCoder, Inc. All rights reserved.
This problem was used for: