花費 7 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