Pregunta de entrevista de ShopUp

Calculate rowsum and colsum of an 2d array in single forloop