topics

全部话题 - 话题: 1337c0d3r
(共0页)
h******k
发帖数: 810
1
ihasleetcode同学,你真是ihas1337code.com的站长1337c0d3r吗?我怎么记得
1337c0d3r去年就说有工作了(http://www.ihas1337code.com/2010/09/my-interview-experience-and-how-i.html),而且从描述看,就是G公司啊。
d****r
发帖数: 80
2
来自主题: JobHunting版 - 1337c0d3r 是何方神圣
看大家都在做leetcode,
八卦一下,谢谢。
w****x
发帖数: 2483
3
来自主题: JobHunting版 - 1337c0d3r 是何方神圣
那就是神一样存在的人物啊~~~
f*******b
发帖数: 520
4
来自主题: JobHunting版 - 1337c0d3r 是何方神圣

他是神的话,杨致远算什么级别呢?
p*****2
发帖数: 21240
5
来自主题: JobHunting版 - 1337c0d3r 是何方神圣

历史
j**c
发帖数: 9
6
来自主题: JobHunting版 - 失荆州 - G电面经
/*
* 失荆州 - G电面经
*
两道G的电面题:
-----------------------------------------------------------
1. You are going to work with “bigNums”, which are
objects containing a positive integer with an
unlimited number of decimal digits.
a) declare a struct to represent “bigNums”
b) write a function that takes as arguments a bigNum
and a positive integer between 0 and 9, adds them
and returns the answer (a bigNum)
10 - 9 = 1
--------------
2. You are given two very large files of unsigned 64
bit integers. Write t... 阅读全帖
f*******7
发帖数: 943
7
改版前的讲解部分写的很好,而且能让人发散思维联系到相关的内容
改版后只有用户去贴code了,也不会有用户写那么详细的分析讲解了
不知道过段时间那个部分会不会加回来。。。
还有就是OJ有test case 那部分,好像新版也没有
谢谢楼下各位及给我发信的同学:
http://leetcode.com/users/1/1337c0d3r
看到页面下面,写着76answers,这些都是他的讲解贴。”
m**********e
发帖数: 22
8
今天重做leetcode:String Reorder Distance Apart。发现1337c0d3r给出的答案(http://discuss.leetcode.com/questions/31/string-reorder-distance-apart)有较大改进的地方:"used" array and the while loop inside the for loop are not needed. I wrote one with C#:
// String Reorder Distance Apart
public string ReorderDistanceApart(string str, int distance)
{
int[] freq = new int[256];
int[] used = new int[256];
bool[] except = new bool[256];
int n = str.Length... 阅读全帖
l*n
发帖数: 529
9
这就来了个流行的word break的题目,真是与时俱进啊。
z*********8
发帖数: 2070
10
我贡献的血汗题目啊。。。
y***n
发帖数: 1594
11
Is this a DP problem, I tried a recursive solution which exceeds time limit
bool wordBreak(string s, unordered_set &dict) {
if(s.length()==0) return true;
bool foundBreak=false;
for(const string& current: dict){
if(s.compare(0, current.size(),current)==0){//find current
foundBreak= wordBreak(s.substr(current.size()), dict);
if(foundBreak)
break;
}
}
return foundBreak;
... 阅读全帖
l****o
发帖数: 315
12
public class Solution {
public boolean wordBreak(String s, Set dict) {
// Note: The Solution object is instantiated only once and is reused
by each test case.
boolean[] f = new boolean[s.length() + 1];
f[0] = true;
for (int i = 0; i <= s.length(); i++)
for (int j = 0; j < i; j++)
if (f[j] && dict.contains(s.substring(j, i))) {
f[i] = true;
break;
}
return f[s.le... 阅读全帖
y***n
发帖数: 1594
13
Nice.
T*******e
发帖数: 4928
14
哈,咱们思路差不多。
bool wordBreak(string s, unordered_set &dict) { //Time: O(n^2)
int sSize=s.size();
if(sSize<=0||dict.empty()) return false;
vector isWord(sSize+1, false);
isWord[0]=true;
for(int i=1; i<=sSize; ++i) {
for(int j=i-1; j>=0; --j) {
if(dict.find(s.substr(j, i-j))!=dict.end() &&isWord[j]) {
isWord[i]=true;
break;
}
}
}
return isWord[sSize];
}

reused
b**m
发帖数: 1466
15
其实是前几天有人问那个(10)的简化版:
public class Solution {
public boolean wordBreak(String s, Set dict) {
if(s.length()==0){
return dict.contains(s);
}
boolean[] reachable = new boolean[s.length()+1];
reachable[0] = true;

for(int i=0;i if(!reachable[i]){
continue;
}
for(int j=i+1;j<=s.length();j++){
String e = s.substring(i,j);
if(dict.con... 阅读全帖
z*********8
发帖数: 2070
16
这个case老是fail在这个test case:
Submission Result: Runtime Error
Last executed input: "aaaaaaa", ["aaaa","aa"]
谁能帮我看看?
public class Solution {
public boolean wordBreak(String s, Set dict) {
// Note: The Solution object is instantiated only once and is reused
by each test case.
boolean[] result = new boolean[s.length()+1];
result[0] = true;
int size = s.length();

for(int i=1; i <= size; ++i)
{
if(result[i] == false && di... 阅读全帖
(共0页)