@BeastlyGerbil presents, the world's very first MOBIUS SUDOKU:
(The left most square backs onto the right most square, and the middle squares back onto each other. The ends are then attached as indicated.)
RULES:
- Normal sudoku rules apply for rows and boxes - boxes are split into groups of 3 indicated by the thicker lines.
- This means that each row must contain the numbers 1 - 9 without repetition.
- Columns ‘wrap around’ over the edge of the mobius strip – 6 cells per column as a result, normal sudoku rules apply on these 6 cells.
- No number will ever be orthogonally adjacent to itself, including across the thicker borders separating the sets of 3 boxes.
- There are 18 total boxes, and as a result 18 total middle cells. There are 2 of each number, 1-9, in the middle cells.
Note: If you need additional information or references for "normal" sudoku, here is a great resource.
👂 Input
Your input will be a collection of integers in \$[1,9]\$, representing each side of a completed strip respectively. Here, collection means whatever type of collection works to meet your needs, so long as you accept a value for every square (front and back). You can use comma delimited lists, arrays, arrays of arrays, n-dimensional arrays, lists, etc. For example in C# using a comma delimited list:
4,6,1,8,5,3,7,9,2,4,8,1,3,9,7,6,5,2,6,4,2,8,1,9,5,3,7,2,7,8,4,9,1,6,5,3,6,7,5,1,4,2,9,3,8,3,8,9,7,2,5,6,1,4,9,5,3,6,2,7,4,1,8,2,9,3,5,8,6,7,1,4,5,7,1,4,6,3,9,8,2,1,9,4,2,8,5,6,3,7,1,9,2,5,7,4,6,3,8,5,7,2,9,8,1,4,3,6,5,6,2,7,3,9,8,1,4,7,6,8,3,2,9,4,5,1,6,8,1,5,4,3,2,9,7,3,7,8,1,4,6,5,9,2,3,4,5,1,6,8,9,2,7,4,3,9,6,7,2,5,8,1
Note: You must tell us how to input the data.
📢 Output
Your output should represent whether or not the provided input is a valid solution using your languages truthy/falsy, with respect to this answer:
if (x) { print "x is truthy"; } else { print "x is falsy"; }
If it results in a runtime or a compile-time error then x is neither truthy nor falsy.
For example in C#, when provided the above input, the expected output is:
true
✔️ Test Cases
Your test inputs will represent both valid and invalid solutions to include the original puzzle's solution:
Test Case 1: 0
Test Case 2: 4,6,1,8,5,3,7,9,2,4,8,1,3,9,7,6,5,2,6,4,2,8,1,9,5,3,7,2,7,8,4,9,1,6,5,3,6,7,5,1,4,2,9,3,8,3,8,9,7,2,5,6,1,4,9,5,3,6,2,7,4,1,8,2,9,3,5,8,6,7,1,4,5,7,1,4,6,3,9,8,2,1,9,4,2,8,5,6,3,7,1,9,2,5,7,4,6,3,8,5,7,2,9,8,1,4,3,6,5,6,2,7,3,9,8,1,4,7,6,8,3,2,9,4,5,1,6,8,1,5,4,3,2,9,7,3,7,8,1,4,6,5,9,2,3,4,5,1,6,8,9,2,7,4,3,9,6,7,2,5,8,1
Test Case 3: 8,8,8,8,8,8,7,9,2,4,8,1,3,9,7,6,5,2,6,4,2,8,1,9,5,3,7,2,7,8,4,9,1,6,5,3,6,7,5,1,4,2,9,3,8,3,8,9,7,2,5,6,1,4,9,5,3,6,2,7,4,1,8,2,9,3,5,8,6,7,1,4,5,7,1,4,6,3,9,8,2,1,9,4,2,8,5,6,3,7,1,9,2,5,7,4,6,3,8,5,7,2,9,8,1,4,3,6,5,6,2,7,3,9,8,1,4,7,6,8,3,2,9,4,5,1,6,8,1,5,4,3,2,9,7,3,7,8,1,4,6,5,9,2,3,4,5,1,6,8,9,2,7,4,3,9,6,7,2,5,8,1
Your outputs should be (again, in C# for example):
Test Case 1: false
Test Case 2: true
Test Case 3: false
Here's a screenshot of the solved grid for reference:
🏅 Scoring
This is code-golf so smallest solution in bytes wins.
📝 Final Note
This challenge is inspired by this puzzle crafted by @BeastlyGerbil. If you like this challenge, go show some love for the original puzzle too!