As amazing as the problem is, it would be immensely helpful if the typo in the example was fixed.
It took me a while and searching online for the real question, so till the question typo is fixed (I have suggested the edit, Anshuman, please fix it), I think this will be helpful.
Consider the input to have the 4th type of box as [10, 12, 32] instead of [1, 2, 3] in the question.
Input 1: A = [ [4, 6, 7] [1, 2, 3] [4, 5, 6] [10, 12, 32] ]
Its commendable that InterviewBit team gets all the relevant questions on this portal. Happy coding guys.