Flexport interview question

Stupid double array matrix problem