Inspired by xkcd.
Your challenge is to determine whether a number would make a good combination in the game 2048. Your input will be a number, such as:
And the output will be whether that number would make a good 2048 combo, which for this input would be
1 or any other way of indicating a positive result.
For those not familiar with the game, here's a simple explanation: powers of two are arranged on a grid, like this:
 . Tiles can be moved in any direction, and if two identical tiles meet, they become the next power of two (so
  when moved left or right becomes
). Or, you could just try the game here.
What does "a good 2048 combination" mean? It means any number that, if it was in the game "2048", it could be combined into one single number. (A zero means an empty space, and can be ignored if needed.) Note that numbers could possibly be multiple digits! However, the numbers must not change between moves. Here are some examples/test cases (with "Good" indicating a good combination, and "Bad" meaning not good):
- Good: 8224 (8224 -> 844 -> 88 -> 16)
- Good: 2222 (2222 -> 44 -> 8)
- Good: 22048 (22048 -> 448 -> 88 -> 16)
- Bad: 20482 (cannot combine the outer 2's, nor can you combine a 2048 and a 2)
- Good: 20482048 (20482048 -> 4096)
- Bad: 210241024 (210241024 -> 22048, but this is now   and cannot be combined since numbers cannot change between moves)
- Good: 2048 (it's already one number)
- Bad: 2047 (it's not a power of 2)
- Bad: 11 (there are no 1's in the game)
- Good: 000040000000 (zeroes are empty spaces)
- Input can be from anywhere reasonable, i.e. STDIN, function argument, file, etc.
- Output can also be anywhere reasonable, i.e. STDOUT, function return value, file, etc.
- Ignore the grid size -
22222222should still output true.
- The is no maximum to what s number could be, as long as it's a power of two. Therefore the possible numbers are any power of two greater than 0.
- For those worried about zeroes causing ambiguity, that is not the case. For example,
22048can be parsed as either
    . The first one doesn't work, but the second one does, so it should output true.
- This is code-golf, so the shortest code in bytes will win!