For the first challenge, we're playing a variant of tetris where there is just one column, and all pieces are single blocks. The pieces come in two colors, and whenever two pieces of the same color come in contact, they both disappear. The goal is to determine if, after some pieces have been dropped in the given order, the playing area is empty.

Input: A sequence of 1s and 0s which represent the two colors. Input format is flexible; all of {[1,0,0,1], 1001, 1 0 0 1} are acceptable formats. The string will have length at most 50.

Output: A standard true value if the playing field is empty, and a standard false value otherwise.


1001    ->True

Languages, by Score

Languages, by Name

Back to Hole List

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License