传送门 Given a list of unique words. Find all pairs of distinct indices (i, j) in the given list, so that the concatenation of the two words, i.e. words[ ...
分类:
其他好文 时间:
2016-05-10 16:45:27
阅读次数:
397
Two tricks here: 1. Counting no. of inversed pairs - using Merge Sort, nothing special 2. How to check 'chaotic'? We simply check if any number is ove ...
分类:
其他好文 时间:
2016-05-07 15:01:28
阅读次数:
132
这道题考验链表的遍历, 切记要加上一个dummy head, 并且区分index的单偶数,不难 ...
分类:
其他好文 时间:
2016-05-03 01:56:47
阅读次数:
126
Given a list of unique words. Find all pairs of distinct indices (i, j) in the given list, so that the concatenation of the two words, i.e. words[i] + ...
分类:
其他好文 时间:
2016-05-02 07:05:56
阅读次数:
279
Given a linked list, swap every two adjacent nodes and return its head. For example,Given 1->2->3->4, you should return the list as 2->1->4->3. Your a ...
分类:
其他好文 时间:
2016-04-30 15:31:00
阅读次数:
158
Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For example, given n = 3, a solution set is: " ...
分类:
其他好文 时间:
2016-04-24 07:33:06
阅读次数:
238
题目:Given a linked list, swap every two adjacent nodes and return its head. For example, Given 1->2->3->4, you should return the list as 2->1->4->3. Yo ...
分类:
其他好文 时间:
2016-04-23 21:23:08
阅读次数:
175
一天一道LeetCode(一)题目
Given n pairs of parentheses, write a function to generate all
combinations of well-formed parentheses.
For example, given n = 3, a solution set is:
“((()))”, “(()...
分类:
其他好文 时间:
2016-04-22 20:58:04
阅读次数:
131
题目:
Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.
For example, given n = 3, a solution set is:
"((()))", "(()())", "(())()", "()(()...
分类:
其他好文 时间:
2016-04-22 20:41:02
阅读次数:
182
题目:
Given a linked list, swap every two adjacent nodes and return its head.
For example,
Given 1->2->3->4, you should return the list as 2->1->4->3.
Your algorithm should use only constant...
分类:
其他好文 时间:
2016-04-22 19:46:19
阅读次数:
131