Pregunta de entrevista de Sasken

Given a 2D array, can you sum all the elements from rows and all the elements from columns distinctly and return the answer from the array. (Code platform: Notepad. Input given. Output format was not given. They were more interested in my though process than the actual code.)