You are viewing a single comment's thread. Return to all comments →
The brightness about this solution is that you don't have to verify each cell of the matrix to know if it is the value you need, cause you already know what cells to pick:
1 row: first and last;
2 row: second and last but one;
3 row: third and last but two;
and so on..
You are not paying attention to what input().split(" ") does. Yes string manipulation library could be highly optimzed that he might be saving some CPU cycles but I'm not sure if string tokenization is constant time operation. Definitely a cleaner and better solution though.