Weird expected output


#1

I’m confused. Why is the expected output for this test case 8?
1 2 3 4
2 3 4 5
3 4 5 6
4 5 6 7
If I choose the 7 I can still choose a 5, even two 5s, that’s already 17, so what’s up with this expected output?
ibscreenshot


#2

Nevermind, I’ve just realized the problem was way more simple than what I thought it was.
I read NN grid instead of 2N grid. No wonder it doesn’t work on a 4*4.


#3

@m.strib thanks for posting, I too was under the impression of NxN grid