The solution has two parts:

  1. Erase zeros and ones pair-wise (blue states).
  2. Set up the final world (red states).