Take a Sudoku Puzzle Generated by my algorithm. Instructions for generating a valid puzzle is the same as solving a constrained n^2 x n^2 Such as this one. ----Take the top left n x n box and enter it into my algorithm and I promise you it will provide correct solution! [123] [456] [789] 123456789 456789100 789100456 004567891 567891004 891004567 045678912 678910045 910045678 And provide this n x n box into my Algorithm as follows [1,2,3,4,5,6,7,8,9](generates valid grid and solves constrained) Note: For grids larger than 9 x 9 please use additonal brackets for readablity. eg. [[01],[02],[03],....] Also, please remember that you need to know multiplication to output a properly mapped n^2 x n^2. For example, a 25 x 25 should be a 5 x 5 for the inputs as follows For x, x = 5 For e, e = 25 for f, f = 5 print('enter with [1,2,3...] brackets') tup = input()[1:-1].split(',') #Input required to map out valid n x m or n^2 x n^2 Sudoku Grid x = input('Enter mapping valid Sudoku eg. 3 for 9 x 9:') e = input('Enter 9 for 9 x 9 ...12 for 12 x 12:') f = input('Enter 3 if its a 9 x 9 ... n^2 x n^2:') x = int(x) e = int(e) f = int(f) #Manipulation of Elements to prepare valid grid squares = [] for i in range(len(tup)): squares.append(tup[i:] + tup[:i]) #Everything below here is just printing for s in range(x): for d in range(0,e,f): for si in range(s,e,f): for li in range(d,d+f): print(squares[si][li], end = '') print('') Output of valid Solution 123456789 456789123 789123456 234567891 567891234 891234567 345678912 678912345 912345678 Spoiler- This Algorithm doesn't just solve constrained 9 x 9. I'm thinking evil for 50x25. Rules will be shared in Part-two for correctly solving 50x25 Update:-For the code to map out grids/solve puzzles correctly you must know the proper inputs. Remember, the rules for a *12 x 12*. it would be *3 x 4* squares. And so on. You'll have to know how a valid Sudoku grid would map out for a n x n. eg. *9 x 9* would be *3 x 3*. There's no reason to downvote working code. I find the reason quite confusing actually. This is on topic. Here's the link to the grid https://cdn.hackaday.io/files/1652867071596224/output.txt Working code linked. https://repl.it/repls/TubbyPrestigiousFirm