花费 34 ms
2Sigma OA prepare: Longest Chain

DP use HashMap: 根据string的长度sort,然后维护每个string的longest chain,default为1,如果删除某个char生成的string能提供更长的cha ...

Wed Dec 14 16:19:00 CST 2016 0 7604
Leetcode: Encode and Decode TinyURL

1. 根据系统设计的Estimation of the amount of data we need to store for the next couple of years, 我们应 ...

Sat Mar 11 12:30:00 CST 2017 1 3709
Leetcode: Reverse Words in a String II

这道题要求in-place做法,不能使用extra space, 那么,做法跟Rotate Array那道题非常相似 (1)reverse the whole array (2)re ...

Sun Mar 01 15:49:00 CST 2015 0 6069
Leetcode: Majority Element

Leetcode的官方答案给的解答很好,我的方法是HashMap. 除了brute force和sorting常见方法以外,还有几个方法,思路都还不错,1是我的方法,我觉得2、4、5都是 ...

Tue Dec 23 12:07:00 CST 2014 0 5812
Leetcode: Best Time to Buy and Sell Stock IV

这道题在Best Time to Buy and Sell Stock III做过,那道题只是把k取了2而已 递推式依然是 local[i][j]=max(global[i-1][j ...

Sun Mar 01 20:40:00 CST 2015 0 3181
Leetcode: Create Maximum Number

We can use greedy method to solve this. num1 can take charge of i(0<=i<=k) numbers and ...

Sat Jan 02 18:17:00 CST 2016 0 2686
面经:Google两轮背靠背

如题,谷歌两轮背靠背电面。两轮都是废话不多说直奔coding,虽然第一轮的中国大哥还是花了一点点时间了解了一下我的背景、毕业时间、research方向。说好的research面呢? 中国大哥出的题: ...

Tue Oct 28 20:15:00 CST 2014 1 2671
Leetcode: Excel Sheet Column Title

这道题是我微软onsite时遇到的一道题,没做过遇到这道题确实有点难一下子理得很清楚(我当时这道题应该做的不好,从most significant digit做,而且忘了n要-1)。这道 ...

Tue Dec 23 20:43:00 CST 2014 0 2323

 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM