Spectrum interview question

To visualize my table outcome