[Community Puzzle] Magic Square

Coding Games and Programming Challenges to Code Better

Send your feedback or ask for help here!

Able to get all test cases passed but validator 2 on final submit is not passing. The similar test case was a list with a single entry. Any suggestions? Thank you.

Then you shouldn’t pass the validators with numbers different from 1 to n^2 either, as that’s the case for validator 2.

Pay attention to every detail of the constrains.
Correct inputs are 1,2,3,4…

0 and -1 are incorrect inputs
Inputs without 1 is incorrect.
Inputs of 1,2,4,5… missing 3 is incorrect
Inputs of 1,1,2… with duplication is incorrect
Inputs of 1.5, non integer, is incorrect

2 Likes

Thank you. Your rec was the “magic”.

Maybe you missed a condition.

The input array is a magic square and my output is that it’s a magic square. But the output of the test says that it’s not.

yes, “filled with distinct positive integers in the range 1, 2 …, n²”

Edit: did I just nullify the educational measures of nicola?

2 Likes

distinct… got it Thanks!

The 7’th test has a 7x7 array filled with 1 and it’s a magic square. But the result of the test says that it’s not magic. It wants displayed “MUGGLE” instead of “MAGIC”. Am I missing something?

Output

I am having a problem with the final unknown validator 7. I know the answer is MUGGLE but why? I have a test for numbers 0 and below. I have a test case for duplicate numbers. I also have a case for missing numbers. I also know by rows, colms and diagonals can equal the magic number when possible.

Hey you made it too obvious. Please delete your obvious clues
Yes eulerscheZahl you did

I fail on Test Cases 5 & 6 and also on Validation Tests 5 & 6. The data for the two Testcases appear to be MAGIC, but the expected answer is MUGGLE.

P.S. Everytime I page down on this forum page, everything disappears for a couple of seconds. Kind of a drag.

DId you check the diagonals?
I didn’t which is why I fail these tests. But back when I solved the puzzle, there were no testcases for that, so I reached 100%.

The scrolling issue was reported here already. A workaround is to just keep scrolling, which makes it a little hard to read the text.

Diagonals, doh! Tanx.