2

Solve the Sudoku

 9 months ago
source link: https://www.geeksforgeeks.org/videos/solve-the-sudoku/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Solve the Sudoku

August 08, 2023 |350 Views
Solve the Sudoku
Problem of the Day, Data Structures and Algorithms, matrix
 Save  Share  1 Like
Description
Discussion

In this video, we are given an incomplete Sudoku configuration in terms of a 9 x 9  2-D square matrix (grid[][]), the task is to find a solved Sudoku. For simplicity, you may assume that there will be only one unique solution.

A sudoku solution must satisfy all of the following rules:

  1. Each of the digits 1-9 must occur exactly once in each row.
  2. Each of the digits 1-9 must occur exactly once in each column.
  3. Each of the digits 1-9 must occur exactly once in each of the 9 3x3 sub-boxes of the grid.
  4. Zeros in the grid indicate blanks, which are to be filled with some number between 1-9. You can not replace the element in the cell which is not blank.

Give the problem a try before going through the video. All the best!!!

Problem Link: https://practice.geeksforgeeks.org/problems/solve-the-sudoku-1587115621/1

Solution IDE Link: https://ide.geeksforgeeks.org/online-cpp14-compiler/bdc1a907-bb87-4a5e-873c-78af9269bdd0

Read More

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK