{"trustable":true,"prependHtml":"\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027\\\\(\u0027, right: \u0027\\\\)\u0027, display: false},\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003e\nA Sudoku grid is a 16x16 grid of cells grouped in sixteen 4x4 squares, where some cells are\nfilled with letters from \u003cb\u003eA\u003c/b\u003e to \u003cb\u003eP\u003c/b\u003e (the first 16 capital letters of the English alphabet), as shown in\nfigure 1a. The game is to fill all the empty grid cells with letters from \u003cb\u003eA\u003c/b\u003e to \u003cb\u003eP\u003c/b\u003e such that each letter\nfrom the grid occurs once only in the line, the column, and the 4x4 square it occupies. The initial\ncontent of the grid satisfies the constraints mentioned above and guarantees a unique solution.\n\u003c/p\u003e\n\n\u003cbr\u003e\u003ccenter\u003e\u003cimg src\u003d\"CDN_BASE_URL/fbb49d75adff8d097803a589986579b9?v\u003d1715212478\"\u003e\u003c/center\u003e\u003cbr\u003e\n\n\u003cp\u003e\nWrite a Sudoku playing program that reads data sets from a text file. Each data set encodes a\ngrid and contains 16 strings on 16 consecutive lines as shown in figure 2. The \u003ci\u003e\u003cb\u003ei\u003c/b\u003e\u003c/i\u003e\nth string stands\nfor the \u003ci\u003e\u003cb\u003ei\u003c/b\u003e\u003c/i\u003e\nth line of the grid, is 16 characters long, and starts from the first position of the line.\nString characters are from the set {\u003cb\u003eA\u003c/b\u003e,\u003cb\u003eB\u003c/b\u003e,...,\u003cb\u003eP\u003c/b\u003e,\u003cb\u003e-\u003c/b\u003e}, where \u003cb\u003e-\u003c/b\u003e (minus) designates empty grid cells. The\ndata sets are separated by single empty lines and terminate with an end of file. The program\nprints the solution of the input encoded grids in the same format and order as used for input.\n\u003c/p\u003e\n\n\u003cp\u003e\u003cb\u003eSample Input\u003c/b\u003e\u003c/p\u003e\n\u003cpre\u003e--A----C-----O-I\n-J--A-B-P-CGF-H-\n--D--F-I-E----P-\n-G-EL-H----M-J--\n----E----C--G---\n-I--K-GA-B---E-J\nD-GP--J-F----A--\n-E---C-B--DP--OE--\nF-M--D--L-K-A\n-C--------O-I-LH-\nP-C--F-A--B---\n---G-OD---J----H\nK---J----H-A-P-L\n--B--P--E--K--A-\n-H--B--K--FI-C--\n--F---C--D--H-N-\n\u003c/pre\u003e\n\n\u003cp\u003e\u003cb\u003eSample Output\u003c/b\u003e\u003c/p\u003e\n\u003cpre\u003eFPAHMJECNLBDKOGI\nOJMIANBDPKCGFLHE\nLNDKGFOIJEAHMBPC\nBGCELKHPOFIMAJDN\nMFHBELPOACKJGNID\nCILNKDGAHBMOPEFJ\nDOGPIHJMFNLECAKB\nJEKAFCNBGIDPLHOM\nEBOFPMIJDGHLNKCA\nNCJDHBAEKMOFIGLP\nHMPLCGKFIAENBDJO\nAKIGNODLBPJCEFMH\nKDEMJIFNCHGAOPBL\nGLBCDPMHEONKJIAF\nPHNOBALKMJFIDCEG\nIAFJOECGLDPBHMNK\n\u003c/pre\u003e"}}]}