Spectrum Interview Question

To visualize my table outcome