Deion: Sudoku Background (数独背景)
Sudoku is a game played on a 9x9 grid. The goal of the game is to fill all cells of the grid with digits from 1 to 9, so that each column, each row, and each of the nine 3x3 sub-grids (also known as blocks) contain all of the digits from 1 to 9. (数独是一个在9x9网格上玩的游戏。 游戏的目标是以1到9的数字填充网格的所有单元格,以便9个3x3子网格(也称为块)中的每列,每行和每一列都包含1的所有数字 到9。)
Sudoku Solution Validator(数独解决方案验证器)
Write a function validSolution that accepts a 2D array representing a Sudoku board, and returns true if it is a valid solution, or false otherwise. The cells of the sudoku board may also contain 0's, which will represent empty cells. Boards containing one or more zeroes are considered to be invalid solutions.(写一个函数validSolution,它接受一个表示数独板的2D数组,如果它是一个有效的解,攻城掠地网页私服,返回true,否则返回false。 数独板的细胞也可能含有0,这将代表空的细胞。 含有一个或多个零的板被认为是无效的解决方案。)
Examples:
Example 1 should return true
Example 2 should return false
本期答案:
欢迎大家踊跃回答,把您认为最简洁、高效、有趣的答案,发送到猿助猿后台!与小编互动即有机会获得价值不菲的精美礼品哦~赶紧“躁”起来吧!
觉得本文有帮助?请分享给更多人
关注「猿助猿」成就顶级开发
来自国外良心游戏厂商Rovio的新作《变态攻城掠地sf(Nibblers)》……
[详细]在本系列的教程当中,你已经熟悉了CSS Grdi的语法,了解了页面布……
[详细]