一、 题目
数独游戏,每一行,每一列,每一个小方格中含有数字1-9且不重复,不要求数字全部出现,可以用’.’代替。判断给出方格的是否符合要求。
二、 分析
第一次玩这个游戏,不知道规则,搜之,原来就是要遍历判断,那就查询每一行,每一列,每一个方格啦!主要的技巧是在判断方格时,可以使用一个四重for循环,优化后使用一个三重循环。
class Solution {
public:
bo...
分类:
其他好文 时间:
2015-02-16 16:58:45
阅读次数:
154
https://oj.leetcode.com/problems/valid-parentheses/Given a string containing just the characters'(',')','{','}','['and']', determine if the input stri...
分类:
其他好文 时间:
2015-02-15 20:30:40
阅读次数:
183
KMP算法Next[]函数深入理解,Next[]当前字符前匹配字符数,串长n-Next[i]=串内循环子串的长度p。本题求子循环串内循环节数。Problem DescriptionFor each prefix of a given string S with N characters (each ...
分类:
其他好文 时间:
2015-02-15 16:25:23
阅读次数:
137
题目Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string.If the last word does not exist, return 0.Note: A word is defined...
分类:
其他好文 时间:
2015-02-15 10:46:47
阅读次数:
120
场景: 想安装SASS的时候,打开cmd,输入gem install sass的时候却出现了: ERROR: Could not find a valid gem 'sass' (>= 0), here is why: Unable to download data from .... ...
分类:
其他好文 时间:
2015-02-15 08:18:57
阅读次数:
679
Given two strings S1 and S2, S = S1 - S2 is defined to be the remaining string after taking all the characters in S2 from S1. Your task is simply to c...
分类:
其他好文 时间:
2015-02-14 16:11:18
阅读次数:
107
On a broken keyboard, some of the keys are worn out. So when you type some sentences, the characters corresponding to those keys will not appear on sc...
分类:
其他好文 时间:
2015-02-14 16:08:30
阅读次数:
177
Longest Substring Without Repeating Characters 解题过程。
分类:
其他好文 时间:
2015-02-14 12:14:20
阅读次数:
117
今天用sbin/start-yarn.sh启动yarn的时候,遇到下面的错误java.lang.IllegalArgumentException: Does not contain a valid host:port authority: master at org.apache.hadoop.ne...
分类:
其他好文 时间:
2015-02-13 19:46:12
阅读次数:
217
题目 判断数独是否成立的一道题,看的是某大神的答案,写的太漂亮了。Determine if a Sudoku is valid, according to: Sudoku Puzzles - The Rules.The Sudoku board could be partially filled, where empty cells are filled with the charact...
分类:
其他好文 时间:
2015-02-13 18:38:44
阅读次数:
114