2014年3月14日

Word Search

摘要: Given a 2D board and a word, find if the word exists in the grid.The word can be constructed from letters of sequentially adjacent cell, where "adjacent" cells are those horizontally or vertically neighboring. The same letter cell may not be used more than once.For example,Givenboard=[ [&q 阅读全文

posted @ 2014-03-14 11:01 pengyu2003 阅读(442) 评论(0) 推荐(1)

Subsets

摘要: Given a set of distinct integers,S, return all possible subsets.Note:Elements in a subset must be in non-descending order.The solution set must not contain duplicate subsets.For example,IfS=[1,2,3], a solution is:[ [3], [1], [2], [1,2,3], [1,3], [2,3], [1,2], []]S先排序下,使全集能够按顺序输出。class Soluti... 阅读全文

posted @ 2014-03-14 09:42 pengyu2003 阅读(131) 评论(0) 推荐(0)

导航