Hi to all ! I agree with @5DN1L : that’s not an error :
→ your task is not to add twice a value in the square, nor in the diagonals …
Hope u found useful our help tip ?
+Please, don’t forget : have sun, fun and codingames !
Hi to all ! I agree with @5DN1L : that’s not an error :
→ your task is not to add twice a value in the square, nor in the diagonals …
Hope u found useful our help tip ?
+Please, don’t forget : have sun, fun and codingames !
Typos, it’s 8n - 15, 12n - 35 and 13n - 42 (the rest of the computation is good so I guess you had it right on your side but wrong when writing your comment)
Your solution has complexity O(n) not O(1).
…my final solution has been “censored” for not spoiler to others, so you didn’t see it…
it is O(1) since it uses a fixed number of operations, regardless of n value
I found the solution, it is cool when you can generalize problem and find an equation.