X Interview Question

box coloring question, and also left and right subarray sum question.