----------------------------------------------------转载-------------------------------------------------------- 应用1描述:n对括号有多少种匹配方式? 思路:n对括号相当于有2n个符号,.....
分类:
其他好文 时间:
2015-01-16 20:37:31
阅读次数:
238
Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation is counted as 1 step.)
You have the following 3 operations permitted on a word:...
分类:
其他好文 时间:
2015-01-16 19:15:26
阅读次数:
177
Given a list of non negative integers, arrange them such that they form the largest number.
For example, given [3, 30, 34, 5, 9], the largest formed number is 9534330.
Note: The result may be ve...
分类:
其他好文 时间:
2015-01-16 19:14:01
阅读次数:
180
1.
ROW_NUMBER() OVER函数的基本用法
语法:ROW_NUMBER() OVER(PARTITION BY COLUMN ORDER BY COLUMN)
例如:row_number() OVER (PARTITION BY
COL1 ORDER BY COL2) 表示根据COL1分组,在分组内部根据 COL2排序,而此函数计算的值就表示每组内部排序后的顺序编号(...
分类:
数据库 时间:
2015-01-16 19:13:39
阅读次数:
283
Given a list of non negative integers, arrange them such that they form the largest number.For example, given[3, 30, 34, 5, 9], the largest formed num...
分类:
其他好文 时间:
2015-01-16 18:43:33
阅读次数:
193
Question:Givenanumbern,givemeafunctionthatreturnsthenthfibonaccinumber.Runningtime,spacecomplexity,iterativevs.recursive.http://www.glassdoor.com/Interview/Given-a-number-n-give-me-a-function-that-returns-the-nth-fibonacci-number-Running-time-space-complexi..
分类:
其他好文 时间:
2015-01-16 17:06:01
阅读次数:
105
Related to question Excel Sheet Column Title
Given a column title as appear in an Excel sheet, return its corresponding column number.
For example:
A -> 1
B -> 2
C -> 3
...
...
分类:
其他好文 时间:
2015-01-16 16:53:37
阅读次数:
118
题意是求逆序数。
先无脑用线段树求出原数列的逆序数。
然后:
不过是把一个数列的第一个数放到最后。这样重复n-1次。在新数列中找出最小的逆序数。
假如第一个数是 a[i] 那么放到最后之后,新数列的逆序数为原数列的逆序数减去比 a[i]小的数,加上比 a[i]大的数。
即 ans=ans-2*a[i]+n-1; 这样就必须把输入的数列存下来。
#include
#i...
分类:
其他好文 时间:
2015-01-16 16:51:22
阅读次数:
187
Implement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of a BST.
Calling next() will return the next smallest number in the BST.
Note: next()...
分类:
其他好文 时间:
2015-01-16 16:50:57
阅读次数:
152
Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where
the candidate numbers sums to T.
Each number in C may only be used once in the combina...
分类:
其他好文 时间:
2015-01-16 16:47:18
阅读次数:
152