Statistics

Problem Statement for "PaperUnfolding"

Problem Statement

You have a sheet of paper and you are looking at it sideways. You can fold the paper exactly in half using one of the following operations:

  1. Fold the right half of the paper counterclockwise over the left half.
  2. Fold the right half of the paper clockwise under the left half.
The following picture illustrates the two possible folds:

Figure 1 shows the original sheet of paper. Figure 2 shows the result of performing fold operation 1, and figure 3 shows the result of performing fold operation 2 (each on the original sheet of paper).

After one initial fold, the paper is two layers thick. You can continue folding the paper any number of times, and each time it will become twice as thick and half as long. The following picture shows one possible sequence of folds:

Figure 1 shows the original sheet of paper. Figure 2 shows the result of performing fold operation 1 on the original sheet. Figure 3 shows the result of performing fold operation 2 on the resulting two-layer sheet.

After some number of folds (possibly zero), you decide to unfold the paper. To do this, you simply work backwards and reverse each fold until you end up with the original sheet. Unfortunately, the paper will now show marks where each of the folds occurred. We go from left to right and label each mark where the paper bends slightly clockwise as an OUT, and each mark where the paper bends slightly counterclockwise as an IN. The following picture shows the unfolded version of the paper from the previous picture.

You are given a String[] code. Concatenate the elements of code to obtain one string. This string contains the marks on an unfolded sheet of paper from left to right, where '1' (one) represents an OUT and '0' (zero) represents an IN. So, for example, the paper in the picture above would be represented as "100". Return "YES" if code represents a piece of paper that could have been produced using the process described above, or "NO" otherwise (all quotes for clarity).

Definition

Class:
PaperUnfolding
Method:
isValidUnfolding
Parameters:
String[]
Returns:
String
Method signature:
String isValidUnfolding(String[] code)
(be sure your method is public)

Constraints

  • code will contain between 0 and 50 elements, inclusive.
  • Each element of code will contain between 1 and 50 characters, inclusive.
  • code will contain only the characters '1' (one) and '0' (zero).
  • The total number of characters in code will be 2^n-1, where n is an integer greater than or equal to zero.

Examples

  1. {}

    Returns: "YES"

    This sheet of paper has no marks, which means that no folding operations were applied.

  2. {"0"}

    Returns: "YES"

    This paper was only folded once.

  3. {"000"}

    Returns: "NO"

    No sequence of valid folds can produce an unfolded sheet containing three consecutive INs.

  4. {"1000110"}

    Returns: "YES"

    Do two folding operations of type 1, and one folding operation of type 2.

  5. {"10001101100111001000110010011101100011011001110110", "00110010011101100011011001110010001100100111001000", "11011001110110001100100111001000110110011100100011", "00100111011000110110011101100011001001110010001101", "10011100100011001001110010001101100111011000110010", "01110"}

    Returns: "YES"

  6. {"0001000100110001101001101101011"}

    Returns: "NO"

  7. {"00011000010000100011001011001101010010010110111010","01111111011110100000011111001000100010111111011110","10001100010011110100110111011100001110011110010111","00000101010101000100001111101011000010101001100000","01100111011101000101000001010101001001110111010010","00110101010001111110001000101000001000100111100110","10110001100001101100111100010011011000011010111010","11000010011000101110001010001000100100110000000100","10110000101101101000011110100011001011111100101110","11010100100000011001000100110001111100111101000000","10001000001"}

    Returns: "NO"

  8. {"00011101110000001001010011100110111010111010010010","11011011101111010100111010101000111011101100011010","100110001111110000000111001"}

    Returns: "NO"

  9. {"001"}

    Returns: "YES"

  10. {"0010001100100000011000001111010"}

    Returns: "NO"

  11. {"0010011000110111001001110011011"}

    Returns: "YES"

  12. {"00100110001101110010011100110111001001100011011000","10011100110110001001100011011100100111001101100010","01100011011000100111001101100010011000110111001001","11001101110010011000110110001001110011011100100110","00110111001001110011011000100110001101100010011100","11011000100110001101110010011100110111001001100011","01100010011100110110001001100011011100100111001101","10001001100011011000100111001101110010011000110111","00100111001101110010011000110110001001110011011100","10011000110111001001110011011000100110001101100010","01110011011000100110001101110010011100110111001001","10001101100010011100110110001001100011011100100111","00110110001001100011011000100111001101100010011000","11011100100111001101110010011000110110001001110011","01110010011000110111001001110011011000100110001101","10001001110011011100100110001101110010011100110111","00100110001101100010011100110110001001100011011100","10011100110110001001100011011000100111001101110010","01100011011100100111001101110010011000110110001001","11001101110010011000110111001001110011011000100110","00110110001001110011011"}

    Returns: "YES"

  13. {"0010011100110111001001100011011"}

    Returns: "YES"

  14. {"0011011"}

    Returns: "YES"

  15. {"001101100010011"}

    Returns: "YES"

  16. {"0011011000100110001101110010011"}

    Returns: "YES"

  17. {"00110110001001110011011100100110001101100010011000","11011100100110001101100010011100110111001001110011","01100010011000110111001001110011011000100111001101","11001001100011011000100110001101110010011100110110","00100111001101110010011100110110001001100011011100","10011000110110001001110011011100100110001101100010","01100011011100100110001101100010011100110111001001","11001101100010011000110111001001100011011000100111","00110111001001100011011000100110001101110010011100","11011000100111001101110010011100110110001001100011","01110010011"}

    Returns: "YES"

  18. {"00110110001001110011011100100110001101100010011000","11011100100111001101100010011100110111001001110011","01100010011000110111001001100011011000100111001101","11001001100011011000100110001101110010011000110110","00100111001101110010011100110110001001100011011100","10011000110110001001110011011100100110001101100010","01100011011100100111001101100010011100110111001001","11001101100010011000110111001001110011011000100111","00110111001001100011011000100110001101110010011000","11011000100111001101110010011100110110001001100011","01110010011"}

    Returns: "YES"

  19. {"00110111001001100011011000100111001101110010011100","11011000100111001101110010011000110110001001100011","01110010011100110110001001100011011100100110001101","10001001110011011100100111001101100010011000110111","00100110001101100010011000110111001001110011011000","10011"}

    Returns: "YES"

  20. {"00110111001001110011011000100110001101110010011000","11011000100111001101110010011100110110001001110011","01110010011000110110001001100011011100100111001101","10001001100011011100100110001101100010011000110111","00100111001101100010011100110111001001100011011000","10011100110111001001110011011000100110001101110010","01100011011000100111001101110010011100110110001001","11001101110010011000110110001001110011011100100111","00110110001001100011011100100110001101100010011000","11011100100111001101100010011100110111001001100011","01100010011"}

    Returns: "YES"

  21. {"001110100111010"}

    Returns: "NO"

  22. {"010"}

    Returns: "NO"

  23. {"01001110101001111110000001101100001111111011110000","10101101011110100011110010101011001111110011111000","00011011111100011001001001111101010010010101100011","11101100010101110010111110010111010011010001100100","00010111001001111100010011101110110110010001000110","00011"}

    Returns: "NO"

  24. {"0101001"}

    Returns: "NO"

  25. {"01011101100011100010111010010010010000101100101001","11000001000011111111001101110000011101101111100110","01100100010101011101001001111101111000110001101010","00001100101110111000100101001010110110001101101011","01111111001111110111111010000110101100010100101110","11111"}

    Returns: "NO"

  26. {"01100001111011111111000100001100010001101001010000","10011111011110011101100010100110110011001010000101","00001001000101111111110111111010001010100000101010","11101100100100100011100111101010010111001000110011","01000010001000010000001101010001110001011001111101","01101010001110001010011101100110110101001001110010","10000000011001110010111101111011100001111011001001","01110100111100111101100000110110010101100011001100","10010011100010111010100100000010110010011001101000","10111101011001001001101000010101111011110001111000","00000100100100000100010011000010111111001110010100","00100010110000011010001010100000111000000101101110","11100011110110010110110010011111111010101101001100","11101000110101001110011101011010111011110010001101","01100101101011000000111110111100100011110101100100","01010111110111111001110111001000100000010001111110","10100101111101100010011011000110100101010001100010","00010110101111010000010011111001000001111110011011","01000101110001001101010101001110001110010110111010","00001010101100111001110100101110100100111001111101","11000010101000010011110111011101111001001001000001","01010110011010011110100100110100101010111111001000","10101101000000111000110010110011100010011110110101","10001111100001001111001111111011100001011001001100","11001000111000101000111111101101011001010000001101","10111101101110011111100000111000010010100000000111","10101010010111101111100100110100110111110010101010","00101100111101101101111100110011010110100101100001","11000101100001011111011111110000000111110111010111","10000111001001000011101011001110110110011001001100","00011110011100111100111000011001100110111011111011","10010011101001111000101110001011000110110100011110","10011101001000100000111100010111010001010011111111","11111010100110010010011001000101010000001001100010","10010000110000101001110100101110010100000111100110","10110001110110110100111111000111111001101001100001","00011001111001000110001001011000100001000100110010","01000001001001101010010100111010010011111111111001","11010010000010110001111010101101111110101110100101","00110111001011010000001101011100111101010010001110","11011011000010101110001101101001110000001010100"}

    Returns: "NO"

  27. {"01100010011100100110001101110010011000100111001101","10001101110010011000100111001001100011011100110110","00100111001101100011011100110110001001110010011000","11011100100110001001110011011000110111001101100010","01110010011000110111001101100010011100110110001101","11001001100010011100100110001101110010011000100111","00110110001101110010011000100111001001100011011100","11011000100111001101100011011100100110001001110010","01100011011100100110001001110011011000110111001101","10001001110010011000110111001101100010011100110110","00110111001001100010011100100110001101110010011000","10011100110110001101110010011000100111001001100011","01110011011000100111001101100011011100110110001001","11001001100011011100100110001001110011011000110111","00110110001001110010011000110111001101100010011100","11011000110111001101100010011100100110001101110010","01100010011100110110001101110010011000100111001001","10001101110011011000100111001101100011011100100110","00100111001001100011011100100110001001110011011000","11011100110110001001110010011000110111001101100010","01110011011000110111001"}

    Returns: "YES"

  28. {"01100010011100110110001101110010011000100111001001","1000110111001"}

    Returns: "YES"

  29. {"01100010011100110110001101110011011000100111001001","10001101110011011000100111001101100011011100100110","00100111001001100011011100110110001001110011011000","11011100110110001001110010011000110111001001100010","01110011011000110111001001100010011100100110001101","11001101100010011100110110001101110011011000100111","00100110001101110011011000100111001101100011011100","10011000100111001001100011011100100110001001110011","01100011011100110110001001110010011000110111001001","10001001110011011000110111001001100010011100100110","00110111001001100010011100110110001101110011011000","10011100100110001101110011011000100111001101100011","01110010011000100111001001100011011100110110001001","11001101100011011100110110001001110010011000110111","00100110001001110011011000110111001001100010011100","10011000110111001001100010011100110110001101110011","01100010011100100110001101110011011000100111001101","10001101110010011000100111001001100011011100100110","00100111001101100011011100110110001001110010011000","11011100100110001001110011011000110111001001100010","01110010011000110111001101100010011100110110001101","11001101100010011100100110001101110011011000100111","00110110001101110010011000100111001001100011011100","11011000100111001101100011011100110110001001110010","01100011011100100110001001110011011000110111001001","10001001110010011000110111001101100010011100110110","00110111001101100010011100100110001101110011011000","10011100110110001101110010011000100111001001100011","01110010011000100111001101100011011100110110001001","11001001100011011100100110001001110011011000110111","00100110001001110010011000110111001101100010011100","11011000110111001101100010011100100110001101110011","01100010011100110110001101110010011000100111001001","10001101110011011000100111001101100011011100110110","00100111001001100011011100100110001001110011011000","11011100100110001001110010011000110111001001100010","01110011011000110111001101100010011100100110001101","11001101100010011100110110001101110010011000100111","00100110001101110010011000100111001101100011011100","11011000100111001001100011011100100110001001110011","01100011011100100110001001110010011000110111001"}

    Returns: "YES"

  30. {"01100011011100110110001001110010011000110111001001","10001001110010011000110111001101100010011100110110","00110111001001100010011100110110001101110011011000","10011100100110001101110010011000100111001101100011","01110011011000100111001101100011011100100110001001","11001001100011011100110110001001110010011000110111","00100110001001110010011000110111001101100010011100","11011000110111001001100010011100100110001101110011","01100010011100100110001101110010011000100111001101","10001101110011011000100111001101100011011100100110","00100111001001100011011100110110001001110010011000","11011100100110001001110010011000110111001101100010","01110011011000110111001001100010011100110110001101","11001101100010011100100110001101110010011000100111","00110110001101110011011000100111001101100011011100","10011000100111001101100011011100110110001001110010","01100011011100100110001001110010011000110111001101","10001001110011011000110111001001100010011100100110","00110111001101100010011100100110001101110010011000","10011100110110001101110011011000100111001101100011","01110010011000100111001"}

    Returns: "YES"

  31. {"01100101011110110111010101100001000100001100010010","10101001001100011101011011010011000011011000001111","01100000101010011110011010101010011011010101110101","00111110010000101001110111010100000001010000111100","01101101100010001011011111001110001011011000010100","00110010001111000101011010111000001010010100001110","00001011101100100010101001101111000000110001011101","00010010010000111101110000111100110001111111011001","10000101100001100000001001011011111011010101000101","00101010011110001010000011001101111001001010010111","11011101000100000011100010001001101111100101010010","00100110111111011000100110110100100000000100010100","11010001101111101100011110000001000010001001000101","10011100011001110011001100101001101000111010000111","00110101001111001111010010101010010001000110111000","10100111110100100000101000001001100100011110111111","00000000100011001110000011000100110000010101101011","01111011001001100110010000001101101011100110011111","10000110100101100110001000111001101000110011111101","00010111011011010100101100110010001011010011100001","00110110001000001011101"}

    Returns: "NO"

  32. {"01110010011000100111001101100010011100100110001101","11001101100010011100100110001001110011011000110111","001001100011011100110110001"}

    Returns: "YES"

  33. {"01110010011000100111001101100011011100100110001101","1100110110001"}

    Returns: "YES"

  34. {"01110010011000110111001101100011011100100110001001","11001101100010011100100110001101110011011000100111","00100110001001110011011000110111001001100011011100","11011000110111001001100010011100110110001101110010","01100011011100110110001001110010011000100111001101","10001001110010011000110111001101100011011100100110","00100111001101100010011100100110001101110011011000","10011100100110001001110011011000100111001001100011","01110011011000110111001001100010011100110110001101","11001001100011011100110110001001110010011000100111","00110110001001110010011000110111001101100011011100","10011000100111001101100010011100100110001101110011","01100010011100100110001001110011011000110111001001","10001101110011011000110111001001100010011100110110","00110111001001100011011100110110001001110010011000","10011100110110001101110010011000110111001101100011","01110010011000100111001101100010011100100110001101","11001101100010011100100110001001110011011000100111","00100110001101110011011000110111001001100010011100","11011000110111001001100011011100110110001001110010","01100010011100110110001001110010011000110111001101","10001101110010011000100111001101100010011100100110","00110111001101100010011100100110001001110011011000","11011100100110001101110011011000110111001001100010","01110011011000110111001001100011011100110110001001","11001001100010011100110110001001110010011000110111","00110110001101110010011000100111001101100010011100","10011000110111001101100010011100100110001001110011","01100010011100100110001101110011011000110111001001","10001001110011011000110111001001100011011100110110","00100111001001100010011100110110001101110010011000","11011100110110001101110010011000100111001101100010","01110010011000110111001101100010011100100110001001","11001101100011011100100110001101110011011000110111","00100110001001110011011000110111001001100011011100","11011000100111001001100010011100110110001101110010","01100011011100110110001101110010011000100111001101","10001001110010011000110111001101100010011100100110","00100111001101100010011100100110001101110011011000","11011100100110001001110011011000110111001001100011","01110011011000100111001001100010011100110110001"}

    Returns: "YES"

  35. {"01110011011000110111001001100010011100110110001001","11001001100011011100110110001101110010011000110111","001101100010011100100110001"}

    Returns: "YES"

  36. {"01110011011000110111001001100011011100110110001001","11001001100010011100110110001101110010011000100111","00110110001001110010011000110111001101100011011100","10011000110111001101100010011100100110001101110011","01100011011100100110001001110011011000100111001001","10001001110011011000110111001001100011011100110110","00100111001001100010011100110110001101110010011000","10011100110110001001110010011000100111001101100011","01110010011000110111001101100010011100100110001101","11001101100011011100100110001001110011011000100111","00100110001"}

    Returns: "YES"

  37. {"1"}

    Returns: "YES"

  38. {"1000110"}

    Returns: "YES"

  39. {"10001100100111001000110110011100100011001001110110","00110110011100100011001001110010001101100111011000","11001001110110001101100111001000110010011100100011","01100111001000110010011101100011011001110110001100","10011100100011011001110110001100100111011000110110","01110"}

    Returns: "YES"

  40. {"10001100100111011000110110011100100011001001110010","00110110011100100011001001110110001101100111011000","11001001110010001101100111011000110010011101100011","01100111001000110010011100100011011001110110001100","10011101100011011001110110001100100111001000110110","01110110001100100111011000110110011100100011001001","11001000110110011100100011001001110110001101100111","01100011001001110010001101100111001000110010011101","10001101100111001000110010011100100011011001110110","00110010011101100011011001110110001100100111001000","11011001110110001100100111011000110110011100100011","00100111001000110110011100100011001001110110001101","10011101100011001001110010001101100111011000110010","01110110001101100111001000110010011100100011011001","11011000110010011101100011011001110110001100100111","00100011011001110010001100100111011000110110011100","10001100100111001000110110011100100011001001110110","00110110011101100011001001110010001101100111001000","11001001110110001101100111001000110010011100100011","01100111011000110010011101100011011001110110001100","10011100100011011001110"}

    Returns: "YES"

  41. {"100011011001110"}

    Returns: "YES"

  42. {"10001101100111011000110010011101100011011001110010","00110010011101100011011001110110001100100111001000","11011001110010001100100111001000110110011101100011","00100111011000110110011100100011001001110010001101","10011101100011001001110010001101100111001000110010","01110"}

    Returns: "YES"

  43. {"100111001000110"}

    Returns: "YES"

  44. {"10011100100011011001110110001100100111001000110010","01110110001100100111001000110110011101100011011001","11001000110010011101100011011001110010001101100111","01100011001001110010001100100111011000110110011100","10001101100111011000110110011100100011001001110110","00110010011100100011011001110110001100100111001000","11001001110110001100100111001000110110011101100011","01100111001000110010011101100011001001110010001101","10011101100011001001110010001100100111011000110110","01110010001101100111011000110110011100100011001001","11011000110110011100100011011001110110001100100111","00100011001001110110001100100111001000110110011101","10001101100111001000110010011101100011011001110010","00110110011101100011001001110010001100100111011000","11011001110010001101100111011000110110011100100011","00100111011000110110011100100011011001110110001100","10011100100011001001110110001100100111001000110110","01110110001101100111001000110010011101100011001001","11001000110110011101100011001001110010001100100111","01100011011001110010001101100111011000110110011100","10001100100111011000110010011100100011011001110110","00110010011100100011001001110110001100100111001000","11011001110110001101100111001000110010011101100011","01100111001000110110011101100011001001110010001100","10011101100011011001110010001101100111011000110110","01110010001100100111011000110010011100100011011001","11011000110010011100100011001001110110001100100111","00100011011001110110001101100111001000110010011101","10001100100111001000110110011101100011001001110010","00110010011101100011011001110010001101100111011000","11011001110010001100100111011000110010011100100011","01100111011000110010011100100011001001110110001100","10011100100011011001110110001101100111001000110010","01110110001101100111001000110110011101100011001001","11001000110010011101100011011001110010001101100111","01100011011001110010001100100111011000110110011100","10001101100111011000110010011100100011001001110110","00110010011100100011011001110110001101100111001000","11001001110110001100100111001000110110011101100011","00100111001000110010011101100011011001110010001101","10011101100011011001110010001100100111011000110"}

    Returns: "YES"

  45. {"10011101100011001001110010001100100111011000110110","01110010001101100111011000110010011100100011011001","11011000110110011100100011011001110110001100100111","00100011001001110110001101100111001000110010011101","10001100100111001000110110011101100011011001110010","00110"}

    Returns: "YES"

  46. {"10011101100011011001110010001101100111011000110010","0111001000110"}

    Returns: "YES"

  47. {"101000101111001"}

    Returns: "NO"

  48. {"1010100"}

    Returns: "NO"

  49. {"10101110111000101100011000111110010010011010001110","0010001110000"}

    Returns: "NO"

  50. {"10110101100110110010101111111101001000010001100101","10001010111100100101001010110001000110111011100100","11000010110101001100100000000001001111000110011011","00110001000110010101110110100011111011100101010110","01111000110110100001010100001100010000010111000011","00110111100001101000101101000000101011101100011111","11110100110011110100001000001000111110000011111000","00100000111010110010011001011101100000000011011110","01010010001101101001010100001000101001100110010011","11101001011011000111010101110001110011110000101000","11110110111"}

    Returns: "NO"

  51. {"110"}

    Returns: "YES"

  52. {"11001000110110011100100111011000110010001101100011","00100111011001110010001101100111001001110110011100","100011011000110010011101100"}

    Returns: "YES"

  53. {"110010011101100"}

    Returns: "YES"

  54. {"11001010000111000010110101101010001000000101101101","10001011110000010000101001110111111110001001100001","00110100011101101000101000000011101101000010011111","01101011000100100100000110111110111001010011110010","00011110110101111000100000001011010110110110000101","11000100001111110010100101000010010001011001000010","00101110111001010111001111110101010000101110011011","00010010001010011100011011001111111110011010011101","01010001000111010110110100011111011100010101011111","00100000100100000001111100010011010100101011011000","11000011110011111101110011010111111000100100110010","00001111010110110011000100000101010111110010001111","11000101001100110100000001111111010100110110010010","01101000001111111000101000110100100010111001110110","00001110000111000101001001101100011010001111010011","11111110101100010001110000001100110011000001010000","01111000001001000110001111010110101001001100110011","01110010010111101011001010100010000110001110101011","00010100110000100000110101101010100100110001111011","01111100101000001111111101111101111000110000101100","10001011000000111000100010100110011101101000111011","11111101111100000100011110100101110001101011101010","01010110110111011011111011110110111011110011011101","10110001010100000101101110001100010010010100101100","01101001010100011001110000010101011001000000010001","11001101101001011101101110110111100011111000011100","00110100101010011000000010100110100110100010110101","11000111111011110111011001000101000000110000001100","10000010000010100011011101010010100010001000010101","01010111100010110001111011010010110100100000000101","01110010100000000111000011111010001100110101101111","11111011011011000110111000000101100111011110011000","11111101010111100001110010010011010010111010110001","11110011001011100111101111000010111101001111011010","00010100101111000100111101101100111110101100000100","01000110111101001110000110111110010101101110101000","00111000101100110000010000110100001010011111010000","00100111011000111001101100111101011011000100000110","10100000000110100111010110011110111110110011011000","10011001010101001001001110011101011110111101000101","11100000000110011100110001100000100101000111011"}

    Returns: "NO"

  55. {"1101100"}

    Returns: "YES"

  56. {"1101100111001000110110001100100"}

    Returns: "YES"

  57. {"11011001110010011101100011001000110110011100100011","01100011001001110110011100100111011000110010011101","100111001000110110001100100"}

    Returns: "YES"

  58. {"11011001110010011101100011001001110110011100100011","01100011001000110110011100100111011000110010001101","10011100100011011000110010011101100111001001110110","00110010011101100111001000110110001100100111011001","11001001110110001100100011011001110010001101100011","00100111011001110010011101100011001001110110011100","10001101100011001000110110011100100111011000110010","00110110011100100011011000110010001101100111001001","11011000110010011101100111001000110110001100100111","01100111001001110110001100100011011001110010001101","10001100100111011001110010011101100011001001110110","01110010001101100011001000110110011100100111011000","11001000110110011100100011011000110010011101100111","00100111011000110010011101100111001000110110001100","10011101100111001001110110001100100011011001110010","00110110001100100011011001110010011101100011001001","11011001110010001101100011001000110110011100100111","01100011001000110110011100100011011000110010001101","10011100100111011000110010011101100111001000110110","00110010011101100111001001110110001100100011011001","11001000110110001100100111011001110010011101100011","00100111011001110010001101100011001000110110011100","10011101100011001000110110011100100011011000110010","01110110011100100111011000110010011101100111001000","11011000110010011101100111001001110110001100100011","01100111001000110110001100100111011001110010011101","10001100100111011001110010001101100011001000110110","01110010011101100011001000110110011100100011011000","11001000110110011100100111011000110010011101100111","00100011011000110010011101100111001001110110001100","10001101100111001000110110001100100011011001110010","01110110001100100111011001110010001101100011001000","11011001110010011101100011001000110110011100100011","01100011001001110110011100100111011000110010011101","10011100100011011000110010011101100111001001110110","00110010001101100111001000110110001100100011011001","11001001110110001100100111011001110010001101100011","00100011011001110010011101100011001000110110011100","10001101100011001000110110011100100111011000110010","01110110011100100011011000110010011101100111001001","11011000110010001101100111001000110110001100100"}

    Returns: "YES"

  59. {"11011110010011000100110010100010111001011001101110","0110010101011"}

    Returns: "NO"

  60. {"111"}

    Returns: "NO"

  61. {"11110000100101101001111000111111110111111001001011","11110111110110011001000101010001111110011110101011","001101000101100101011010101"}

    Returns: "NO"

  62. {"11111110001100000010010011010000101000000100111110","00110110100110110101011010110010100110111010011001","10000100110000111011000101100111100011011110100100","01001011011010000000101011100101000111110101010011","11100010100001011011111100011010011111110011101010","10111001101011101011110111000010110011011100110001","01011100110001011110100101101001111001110100010000","10100110010010100100000111011100001100110001010111","11100101100001110110111101111011010101011010010100","10000011010001000011110011001000001010110000001100","01101000100000110101010001101101111110000111100110","01111000011000111111000110001111101111011001011011","01011111100011011000110010111001011111111001101010","00101111101100111100101001010100100001000101000000","01001000100011110101001110000011100010010110010001","01011110001100111111010111000010101000111101110101","01110110101110111000111000000100010101011110010111","00100111011101101110011000001101000111000110000001","00111100110000011000100000000111111010011111000100","11110111001010010111100110101100101010110110000011","00100000110000101111000"}

    Returns: "NO"

  63. {"0000111" }

    Returns: "NO"

  64. {"1111000" }

    Returns: "NO"

  65. {"1110000" }

    Returns: "NO"

  66. {"101" }

    Returns: "NO"

  67. {"001" }

    Returns: "YES"

  68. {"110", "1001001101001110100110110100" }

    Returns: "NO"

  69. {"000" }

    Returns: "NO"

  70. {"1011010" }

    Returns: "NO"

  71. {"000000001111111" }

    Returns: "NO"

  72. {"1001011" }

    Returns: "NO"

  73. {"000011001001111" }

    Returns: "NO"

  74. {"10001101100111001000110010011101100011011001110110", "00110010011101100011011001110010001100100101001000", "11011001110110001100100111001000110110011100100011", "00100111011000110110011101100011001001110010001101", "10011100100011001001110010001101100111011000110010", "01110" }

    Returns: "NO"


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: