摘要: 这个题目是典型的KMP算法,当然也可以试试BM,当然有关KMP和BM的介绍阮一峰曾经写过比较好的科普,然后july也有讲解,不过那个太长了。 先放题目吧: Implement strStr(). Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of hays... 阅读全文
posted @ 2014-12-02 15:43 Tiny-Box 阅读(167) 评论(0) 推荐(0) 编辑
摘要: 这道题目被放在的简单的类别里是有原因的,题目如下: 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 character '.'. A... 阅读全文
posted @ 2014-12-02 15:19 Tiny-Box 阅读(167) 评论(0) 推荐(0) 编辑