2015年3月10日

Combination Sum II

摘要: Combination Sum II问题:Given a collection of candidate numbers (C) and a target number (T), find all unique combinations inCwhere the candidate numbers ... 阅读全文

posted @ 2015-03-10 16:27 zhouzhou0615 阅读(247) 评论(0) 推荐(0) 编辑

Combination Sum

摘要: Combination Sum问题:Given a set of candidate numbers (C) and a target number (T), find all unique combinations inCwhere the candidate numbers sums toT.T... 阅读全文

posted @ 2015-03-10 16:16 zhouzhou0615 阅读(160) 评论(0) 推荐(0) 编辑

Sudoku Solver

摘要: Sudoku Solver问题:Write a program to solve a Sudoku puzzle by filling the empty cells.Empty cells are indicated by the character'.'.You may assume that ... 阅读全文

posted @ 2015-03-10 15:17 zhouzhou0615 阅读(148) 评论(0) 推荐(0) 编辑

Valid Sudoku

摘要: Valid Sudoku问题:Determine if a Sudoku is valid, according to:Sudoku Puzzles - The Rules.The Sudoku board could be partially filled, where empty cells a... 阅读全文

posted @ 2015-03-10 09:48 zhouzhou0615 阅读(102) 评论(0) 推荐(0) 编辑

2015年3月9日

Combinations

摘要: Combinations问题:Given two integersnandk, return all possible combinations ofknumbers out of 1 ...n.思路: dfs + 回溯我的代码:public class Solution { public ... 阅读全文

posted @ 2015-03-09 11:20 zhouzhou0615 阅读(158) 评论(0) 推荐(0) 编辑

Generate Parentheses

摘要: Generate Parentheses问题:Givennpairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, givenn= 3, a ... 阅读全文

posted @ 2015-03-09 08:54 zhouzhou0615 阅读(172) 评论(0) 推荐(0) 编辑

2015年3月8日

Pascal's Triangle II

摘要: Pascal's Triangle II问题:Given an indexk, return thekthrow of the Pascal's triangle.For example, givenk= 3,Return[1,3,3,1].思路: 简单的数学推理即可我的代码:public cla... 阅读全文

posted @ 2015-03-08 21:46 zhouzhou0615 阅读(140) 评论(0) 推荐(0) 编辑

Pascal's Triangle

摘要: Pascal's Triangle问题:GivennumRows, generate the firstnumRowsof Pascal's triangle.思路: 简单的数学推理我的代码:public class Solution { public List> generate(int ... 阅读全文

posted @ 2015-03-08 21:11 zhouzhou0615 阅读(154) 评论(0) 推荐(0) 编辑

Merge Sorted Array

摘要: Merge Sorted Array问题:Given two sorted integer arrays A and B, merge B into A as one sorted array.Note:You may assume that A has enough space (size tha... 阅读全文

posted @ 2015-03-08 21:00 zhouzhou0615 阅读(122) 评论(0) 推荐(0) 编辑

Linked List Cycle II

摘要: Linked List Cycle II问题:Given a linked list, return the node where the cycle begins. If there is no cycle, returnnull.Follow up:Can you solve it withou... 阅读全文

posted @ 2015-03-08 20:42 zhouzhou0615 阅读(116) 评论(0) 推荐(0) 编辑

导航