1 public class Solution { 2 public List getRow(int rowIndex) { 3 List result = new ArrayList(); 4 for (int i=0; i=0; j--) { 6 ...
分类:
其他好文 时间:
2014-09-10 21:02:51
阅读次数:
180
[leetcode]Reverse Linked List II...
分类:
其他好文 时间:
2014-09-10 12:36:40
阅读次数:
220
N-Queens II
Total Accepted: 12668 Total
Submissions: 38109My Submissions
Follow up for N-Queens problem.
Now, instead outputting board configurations, return the total number of distinct...
分类:
其他好文 时间:
2014-09-10 09:38:20
阅读次数:
218
最近找工作,免不了看CC150 刷 LeetCode 来练手,练习之余也向各路大神 系统并且深入的学习、巩固一下算法知识。一. 线性表1. 数组 Remove Duplicates from Sorted Array Remove Duplicates from Sorted Array II .....
分类:
其他好文 时间:
2014-09-10 08:21:50
阅读次数:
246
Jump Game II
Total Accepted: 16242 Total
Submissions: 65802My Submissions
Given an array of non-negative integers, you are initially positioned at the first index of the array.
Each elem...
分类:
其他好文 时间:
2014-09-10 01:38:59
阅读次数:
227
Path Sum II
Total Accepted: 18489 Total
Submissions: 68323My Submissions
Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.
For exampl...
分类:
其他好文 时间:
2014-09-10 01:38:49
阅读次数:
223
Word Break II
Total Accepted: 15138 Total
Submissions: 92228My Submissions
Given a string s and a dictionary of words dict, add spaces in s to construct a sentence where each word is a va...
分类:
其他好文 时间:
2014-09-10 00:30:09
阅读次数:
221
Follow up for problem "Populating Next Right Pointers in Each Node".What if the given tree could be any binary tree? Would your previous solution stil...
分类:
其他好文 时间:
2014-09-09 19:57:29
阅读次数:
237
Reverse Linked List II
Reverse a linked list from position m to n. Do it in-place and in one-pass.
For example:
Given 1->2->3->4->5->NULL, m = 2 and n = 4,
return 1->4->3->2->5->NULL.
Note...
分类:
其他好文 时间:
2014-09-09 18:23:49
阅读次数:
222
大意:有n个男孩n个女孩,告诉你每个女孩喜欢哪些男孩,又告诉你女孩之间的存在一些朋友关系一个女孩可以和她喜欢的男孩结婚也可以和她朋友喜欢的男孩结婚, 并且朋友关系可以传递Once every girl finds their boyfriends they will start a new roun...
分类:
其他好文 时间:
2014-09-09 17:51:29
阅读次数:
187