码迷,mamicode.com
首页 > 编程语言 > 详细

Java for LeetCode 037 Sudoku Solver

时间:2015-05-08 21:55:55      阅读:145      评论:0      收藏:0      [点我收藏+]

标签:

Write a program to solve a Sudoku puzzle by filling the empty cells.

Empty cells are indicated by the character ‘.‘.

You may assume that there will be only one unique solution.

解题思路:

经典的NP问题,暴力枚举即可,采用Dancing Links可以优化算法,参考链接:https://www.ocf.berkeley.edu/~jchu/publicportal/sudoku/sudoku.paper.html

JAVA实现如下:

 

Java for LeetCode 037 Sudoku Solver

标签:

原文地址:http://www.cnblogs.com/tonyluis/p/4488727.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!