由买买提看人间百态

topics

全部话题 - 话题: leetcode
首页 上页 1 2 3 4 5 6 7 8 9 10 (共10页)
f*****7
发帖数: 92
1

poj大都是算法,而且只care时间
一般空间是不会超的
面试会有很多data structures的题目
并且是真人交流,考察的层面不一样
找工作主要还是leetcode
有闲情了刷刷poj也无妨
b*********h
发帖数: 103
2
就现在的面试题来看 很多是 acm 题 而这种难度的题在比赛里几分钟就可以被搞出来
所以说是水题
可能楼主是想说,做 leetcode 和 careercup 并没有提升算法功底,因为面试题问的
都挺直接,并没涉及什么算法 所以不建议拿这些准备
其实觉得准备面试还是做这些好了 拿到好 offer 确实有过人之处 只是未必是算法学
好了 搞过竞赛准备面试题还是很便利的
p*****2
发帖数: 21240
3

什么意思? 我看了我输出的结果跟leetcode上一样呀。
a********3
发帖数: 228
4
lz今天被面了一道经典算法实现,不是150和leetcode上的,lz没有复习过,虽然写出
来了,但因为紧张范了点小错。
O******i
发帖数: 269
5
来自主题: JobHunting版 - 感觉leetcode的OJ有点太偏重DP了
ft, 二爷就是leetcode本尊?
m******k
发帖数: 593
6
来自主题: JobHunting版 - 感觉leetcode的OJ有点太偏重DP了
二爷被leetcode招安了?
w****x
发帖数: 2483
7
来自主题: JobHunting版 - 如何做LeetCode

二爷说说为什么leetcode要做几遍?
b*****n
发帖数: 482
8
来自主题: JobHunting版 - 如何做LeetCode
我其实最近才开始做leetcode,一周时间,到现在刚好50题。我先来抛块砖吧,讲讲自
己的体会:
1. 先看思路领会透不透。譬如说peranthese matching, largest rectangle, maximum
rectangle 这些题。还有kth largest, median of two sorted arrays。特别是
median of two sorted arrays,思路和细节吃透了, 再要写一遍的话,bug free并不
算特别难。当然我是指“再写一遍”。我知道peking2的目标可能是没见过面的5分题一
次写对:),那可真得下功夫。
2. 再看固定模式熟不熟。tree的recursive,string matching的dp,math里用的移位
和二分法,数组的左右指针,单链表的双指针traverse/delete。这些基本的东西要有
敏感度。
3. corner case要cover够。空指针,0长度,integer记住有负数,unsigned包括0,
duplicate怎么处理,会不会overflow,out of range,loop能不能... 阅读全帖
p*****2
发帖数: 21240
9
来自主题: JobHunting版 - 如何做LeetCode

maximum
能不能谈谈你做leetcode之前的基础?比如做过几百道题了?
w****x
发帖数: 2483
10
来自主题: JobHunting版 - 如何做LeetCode

二爷说说这个程度怎么度量,比如一个月没做leetcode再做的话要多少的通过率?
h*******0
发帖数: 270
11
来自主题: JobHunting版 - 如何做LeetCode
二爷,你有时间的时候把你做过的leetcode的代码贴出来被? 让我们这些菜鸟学习下?
w****x
发帖数: 2483
12
来自主题: JobHunting版 - 如何做LeetCode

二爷说说为什么leetcode要做几遍?
b*****n
发帖数: 482
13
来自主题: JobHunting版 - 如何做LeetCode
我其实最近才开始做leetcode,一周时间,到现在刚好50题。我先来抛块砖吧,讲讲自
己的体会:
1. 先看思路领会透不透。譬如说peranthese matching, largest rectangle, maximum
rectangle 这些题。还有kth largest, median of two sorted arrays。特别是
median of two sorted arrays,思路和细节吃透了, 再要写一遍的话,bug free并不
算特别难。当然我是指“再写一遍”。我知道peking2的目标可能是没见过面的5分题一
次写对:),那可真得下功夫。
2. 再看固定模式熟不熟。tree的recursive,string matching的dp,math里用的移位
和二分法,数组的左右指针,单链表的双指针traverse/delete。这些基本的东西要有
敏感度。
3. corner case要cover够。空指针,0长度,integer记住有负数,unsigned包括0,
duplicate怎么处理,会不会overflow,out of range,loop能不能... 阅读全帖
p*****2
发帖数: 21240
14
来自主题: JobHunting版 - 如何做LeetCode

maximum
能不能谈谈你做leetcode之前的基础?比如做过几百道题了?
w****x
发帖数: 2483
15
来自主题: JobHunting版 - 如何做LeetCode

二爷说说这个程度怎么度量,比如一个月没做leetcode再做的话要多少的通过率?
h*******0
发帖数: 270
16
来自主题: JobHunting版 - 如何做LeetCode
二爷,你有时间的时候把你做过的leetcode的代码贴出来被? 让我们这些菜鸟学习下?
c********t
发帖数: 5706
17
上leetcode
Site Temporarily Unavailable
We apologize for the inconvenience. Please contact the webmaster/ tech
support immediately to have them rectify this.
error id: "bad_httpd_conf"
上新浪博客
The connection has timed out
其他网站都能上,ie, firefox一样效果。
换了电脑也上不了。
求帮助!
h**6
发帖数: 4160
18
来自主题: JobHunting版 - 关于leetcode请教二爷
GCJ就有这点好处,可以及时运行测试用例检查结果,如果小数据能通过,一般只要大
数据能跑完就没什么问题了。

我现在对LeetCode的OJ依赖性很强,没有OJ对自己的代码不是很有信心。
w***o
发帖数: 109
19
来自主题: JobHunting版 - leetcode 这题的解法是不是错了?
CTRL+A, CTRL+C, CTRL+V http://leetcode.com/2011/01/ctrla-ctrlc-ctrlv.html
如果n等于33的话,用上面的code得到3072,难道不应该是3125吗?
w***o
发帖数: 109
20
来自主题: JobHunting版 - leetcode 这题的解法是不是错了?
不知道是不是面试题,反正Leetcode上有。
w***o
发帖数: 109
21
来自主题: JobHunting版 - leetcode 这题的解法是不是错了?
CTRL+A, CTRL+C, CTRL+V http://leetcode.com/2011/01/ctrla-ctrlc-ctrlv.html
如果n等于33的话,用上面的code得到3072,难道不应该是3125吗?
w***o
发帖数: 109
22
来自主题: JobHunting版 - leetcode 这题的解法是不是错了?
不知道是不是面试题,反正Leetcode上有。
r*****e
发帖数: 792
23
来自主题: JobHunting版 - leetcode 这题的解法是不是错了?
leetcode上这道题有个回帖的方法非常好,基本思想是当n>=10后用这个公式:
f[n] = max(f[n-4]*2, f[n-5]*3, f[n-6]*4, f[n-7]*5, f[n-8]*6, f[n-9]*7);
不过我是想不出来这样的解,只能看明白。
h****e
发帖数: 928
24
这道题目要么用正则表达式,一两行的代码,要么是brute force,
下面给出的解法就很简洁:
http://dl.dropbox.com/u/19732851/LeetCode/ValidNumber.html
h****e
发帖数: 928
25
这道题目要么用正则表达式,一两行的代码,要么是brute force,
下面给出的解法就很简洁:
http://dl.dropbox.com/u/19732851/LeetCode/ValidNumber.html
e******i
发帖数: 106
26
来自主题: JobHunting版 - leetcode 上单链表转BST那道题求指导
leetcode上单链表转BST上那道题我用JAVA写了,可是测试就是过不了,求大神看看我
的code。
我确实看不出问题在哪儿,不会是getlength那个Method写错了吧
public class Solution {
public TreeNode sortedListToBST(ListNode head) {
// Start typing your Java solution below
// DO NOT write main() function
int length = getListLength(head);
return sortedListToBST(head, 1, length);
}

public TreeNode sortedListToBST(ListNode head, int start, int end){
if(start>end)
return null;
int mid = start ... 阅读全帖
e******i
发帖数: 106
27
来自主题: JobHunting版 - leetcode 上单链表转BST那道题求指导

,
谢谢指导,我来顺着你的思路看看,我是把leetcode上那篇blog里的copy过来,结果不
行。一时半会儿还真没有看出问题
n****r
发帖数: 120
28
来自主题: JobHunting版 - leetcode 上单链表转BST那道题求指导
LeetCode上对Java的建议是可以是用一个全局变量来保存head!这个是可行的。另外一
个方法就是把head包在一个数组里,传入该数组
j*****s
发帖数: 189
29
来自主题: JobHunting版 - LeetCode 更新
不知道大家注意到没,leetCode最近新加入了不少题,大家有兴趣的可以做做。
B*******1
发帖数: 2454
30
来自主题: JobHunting版 - LeetCode 更新
这个是leetcode最早的前30题了吧。
l*****a
发帖数: 559
31
来自主题: JobHunting版 - LeetCode 更新
follow leetcode on twitter or facebook
you will get the notification
p*****2
发帖数: 21240
32
来自主题: JobHunting版 - LeetCode 更新

http://leetcode.cloudfoundry.com/
p*****2
发帖数: 21240
33
LeetCode上的Decode Ways是一道Facebook的面试原题,而这道题的起源则是2012 黑客
杯第一轮的第三题。有网友问如何使用O(1)的space做DP?其实原题是不可以的,因为M
是变化的。而Decode Ways给简化为M=26了,这样才可以用O(1) space。由于想为了这
届黑客杯做做练习,用Ruby重新实现了一下。
http://blog.sina.com.cn/s/blog_b9285de20101h8l1.html
l*****a
发帖数: 14598
34
来自主题: JobHunting版 - leetcode oj 不 work 了?
whether the url in address bar is as http://leetcode.com/onlinejudge# ?
if so,remove the # and refresh
p*****2
发帖数: 21240
35
来自主题: JobHunting版 - leetcode online judge改版了?
我这个网站可以按照字母排序
http://leetcode.cloudfoundry.com/
s*********s
发帖数: 140
36
来自主题: JobHunting版 - leetcode online judge改版了?
update:发现http://leetcode.cloudfoundry.com/ 可以按字母排序,可以对照使用,虽然有点不方便。供有同样问题的人参考。
K*****k
发帖数: 430
37
来自主题: JobHunting版 - leetcode的iphone5壁纸
感觉和leetcode联系不大,leet这个单词本身就是一个流行词,Wiki一下就知道了。
w**********o
发帖数: 140
c********r
发帖数: 286
39
来自主题: JobHunting版 - Leetcode上DP的那些事儿
请问大牛门,Leetcode上除了edit distance, unique path, minimum path...
whatever path
还有哪些可以用DP解的呢? 想多练习一下thinking in DP,望大牛们指教 :)
p*****2
发帖数: 21240
40
来自主题: JobHunting版 - Leetcode上DP的那些事儿
http://leetcode.cloudfoundry.com/
看我的归类,大概19道吧
w****a
发帖数: 710
41
DP也可以的,把vector换成原生数组,保证能过大集合。
在leetcode里经常遇到用vector在遍历的时候比数组慢很多的情况。
我估计他们开DEBUG宏了?还是没有设置优化?
b******g
发帖数: 77
42
来自主题: JobHunting版 - Permutation leetcode-
Prof. Sedgewick的书里讲过 generate permutation 的算法。
比leetcode 和 150 的解法 快 且简单
void collectPermutation(string& txt, vector &bag)
{
collectPermutation(txt, txt.length(), bag);
}
void collectPermutation(string& txt, long N, vector& bag)
{
if (N == 1)
{
bag.push_back(txt);
return;
}
for (long i = 0; i < N; ++i)
{
swap(txt[i], txt[N]);
collectPermutation(str, N - 1, bag);
swap(txt[i], txt[N]);
}
}
i******t
发帖数: 22541
43
来自主题: JobHunting版 - leetcode triganle 通不过。。。
自己编辑可以通过啊 放在leetcode 说time error。。。
咋回事啊
class Solution {
public:
int minimumTotal(vector > &triangle) {
// Start typing your C/C++ solution below
// DO NOT write int main() function
int minV = INT_MAX;
int m = triangle.size();
vector > vecV;
vecV.resize(m);
if(m==0) return 0;
if(m==1) return triangle[0][0];

vecV[0][0]=triangle[0][0];
for(int i=1;i {
int... 阅读全帖
p*****p
发帖数: 379
k***x
发帖数: 6799
45
来自主题: JobHunting版 - Leetcode网站又有人发spam email了
XXX sent you a new message:
Subject: hello
"
Hello how are you?
My name is YYY,i am a female,and i became interested in you when i saw your
profile(leetcode.com)
and i will like to established a good relationship with you.if you will not
mind kindly get to me through my email (z*[email protected]) so that i will tell
you more about me and also
give you my pictures, i have a special reason to contact you.
hoping to hear from you soonest
yours new friend mery
PLEASE REPLY NOW WITH THIS EMAIL ADDRESS (zz... 阅读全帖
b****g
发帖数: 192
46
来自主题: JobHunting版 - 那里有leetcode的答案?
leetcode首页上那些题都带答案,但是Interview Questions Online Judge都不带答案
啊。我看到有网友自己在博客写的答案,但是都不带分析,有时候看不明白。
b****g
发帖数: 192
47
Two elements of a binary search tree (BST) are swapped by mistake.
Recover the tree without changing its structure.
看了leetcode的discuss,也没给出思路。而且貌似也改变树的结构了。
b****g
发帖数: 192
48
Two elements of a binary search tree (BST) are swapped by mistake.
Recover the tree without changing its structure.
看了leetcode的discuss,也没给出思路。而且貌似也改变树的结构了。
L***n
发帖数: 311
49
来自主题: JobHunting版 - 请教大牛如何做leetcode上面的题?
150已经做过一遍了。看leetcode的archive好像从2010到2012一共不到80题的样子。这
个网站是按什么organize的?
L***n
发帖数: 311
50
来自主题: JobHunting版 - 请教大牛如何做leetcode上面的题?
哦 I see。所以你们平时说的leetcode就是这全部125道题了?好吧,又有新目标了
首页 上页 1 2 3 4 5 6 7 8 9 10 (共10页)