avatar
什么是resident alien?# Immigration - 落地生根
a*e
1
写了很久都过不了,15分钟哪里能写完啊?能把思路说清楚就不错了。不知道什么样的
公司和面试官会出这种题。
https://oj.leetcode.com/problems/word-ladder-ii/
vector> findLadders(string start, string end, unordered_set<
string> &dict) {
vector> res;
vector> empty;
queue curLevel;
queue nextLevel;
vector path;
path.push_back(start);
curLevel.push(start);
res.push_back(path);
string word = start;
bool find = false;
int n = word.size();
bool change = false;
while (!curLevel.empty() || !nextLevel.empty())
{
if (find)
break;
if (curLevel.empty() && !nextLevel.empty())
{
curLevel.swap(nextLevel);
}
word = curLevel.front();
curLevel.pop();
if (word == end)
break;
for (int i = 0; i < n; i++)
{
string tmp = word;
for (int j = 0; j < 26; j++)
{
char tc = 'a' + j;
if (word[i] != tc)
{
tmp[i] = tc;
if (dict.find(tmp) != dict.end() || tmp == end)
{
nextLevel.push(tmp);
if (tmp == end)
{
find = true;
break;
}
dict.erase(tmp);
change = true;
}
}
}
//
if (change)
{
}
}
if (nextLevel.size() > 0)
{
int m = nextLevel.size();
queue tmpNext;
if (m > 1)
{
int oResSize = res.size();
for (int mm = 1; mm < m; mm++)
{
for (int k = 0; k < oResSize; k++)
{
res.insert(res.begin() + k, res[k]);
}
}
}

//res.insert(res.begin(),res.begin(),res.end());
for (int k = 0; k < res.size(); k++)
{
if (res[k].back() == word)
{
string tmp = nextLevel.front();
nextLevel.pop();
res[k].push_back(tmp);
tmpNext.push(tmp);
}
}
nextLevel = tmpNext;
}
}
if (!find) return empty;
else
{
for (int k = 0; k < res.size(); k++)
{
if (res[k].back() != end)
res.erase(res.begin() + k);
}
return res;
}
avatar
t*c
2
看了一下,好像只能在店里进行
有人试过吗?能overpay么?
谢谢
avatar
f*e
3
【 以下文字转载自 EB23 讨论区 】
发信人: fayee (BSH), 信区: EB23
标 题: 什么是resident alien?
发信站: BBS 未名空间站 (Sat Apr 13 00:37:04 2013, 美东)
USCIS上查了,看的不是很懂.如果一个人几年前是正常签证出来的,现在I-485pending,
算是resident alien吗? permanent resident是指有绿卡的人吗? 还有什么是 alien
registration card(Form 1551)?
申请的学校今天来信说:
In reviewing your file, you indicated that you are a non-citizen. If you
are a refugee or permanent resident, forward a copy of your permanent
resident card, alien registration card (Form 1551) or a copy of the passport
stamp worded "Processed for 1-551" in order for us to complete your
application. A copy of the card must be forwarded to our office within 30
days from the date of this email or your application will be sent to
International Admissions for processing.
我觉得我应该不算是international admission吧.在美国已经好几年了.也在美国上过
学,现在有收入也在交所住州的税.请大家帮我看看,问题比较多,比较着急,谢谢大家了.
avatar
r*e
4
这道题15分钟写完倒是可能会挂掉——必然是做过的。15分钟都很难讲清楚。
avatar
m*y
5
in store only and no overpay

【在 t**c 的大作中提到】
: 看了一下,好像只能在店里进行
: 有人试过吗?能overpay么?
: 谢谢

avatar
f*n
6

就是绿卡。你没有。
你在申请学校吗?一般没有绿卡的人要为international student申请,无论你在这里
多久。
要看学校的具体要求。

【在 f***e 的大作中提到】
: 【 以下文字转载自 EB23 讨论区 】
: 发信人: fayee (BSH), 信区: EB23
: 标 题: 什么是resident alien?
: 发信站: BBS 未名空间站 (Sat Apr 13 00:37:04 2013, 美东)
: USCIS上查了,看的不是很懂.如果一个人几年前是正常签证出来的,现在I-485pending,
: 算是resident alien吗? permanent resident是指有绿卡的人吗? 还有什么是 alien
: registration card(Form 1551)?
: 申请的学校今天来信说:
: In reviewing your file, you indicated that you are a non-citizen. If you
: are a refugee or permanent resident, forward a copy of your permanent

avatar
C*a
7
这是我最喜欢的题目,一分钟bugfree

【在 a***e 的大作中提到】
: 写了很久都过不了,15分钟哪里能写完啊?能把思路说清楚就不错了。不知道什么样的
: 公司和面试官会出这种题。
: https://oj.leetcode.com/problems/word-ladder-ii/
: vector> findLadders(string start, string end, unordered_set<
: string> &dict) {
: vector> res;
: vector> empty;
: queue curLevel;
: queue nextLevel;
: vector path;

avatar
t*c
8
谢谢

【在 m******y 的大作中提到】
: in store only and no overpay
avatar
x*a
9
一看到用queue就必定是错的。
要用unordered_set。理由自己好好想一想。

【在 a***e 的大作中提到】
: 写了很久都过不了,15分钟哪里能写完啊?能把思路说清楚就不错了。不知道什么样的
: 公司和面试官会出这种题。
: https://oj.leetcode.com/problems/word-ladder-ii/
: vector> findLadders(string start, string end, unordered_set<
: string> &dict) {
: vector> res;
: vector> empty;
: queue curLevel;
: queue nextLevel;
: vector path;

avatar
h*k
10
据说某E开头公司onsite面过
avatar
s*x
11
Break to small functions and write the most important ones first.
avatar
k*a
12
有人知道word ladder II的时间复杂度吗?
谢谢!
avatar
r*e
13
O(size*length*26)
你LinkedIn有下文么?

【在 k*******a 的大作中提到】
: 有人知道word ladder II的时间复杂度吗?
: 谢谢!

avatar
k*a
14
挂了

【在 r*******e 的大作中提到】
: O(size*length*26)
: 你LinkedIn有下文么?

avatar
s*r
15
面ebay的时候问过。写出来了,但还是悲剧,有两轮印度面试官
avatar
a*e
16
写了很久都过不了,15分钟哪里能写完啊?能把思路说清楚就不错了。不知道什么样的
公司和面试官会出这种题。
https://oj.leetcode.com/problems/word-ladder-ii/
vector> findLadders(string start, string end, unordered_set<
string> &dict) {
vector> res;
vector> empty;
queue curLevel;
queue nextLevel;
vector path;
path.push_back(start);
curLevel.push(start);
res.push_back(path);
string word = start;
bool find = false;
int n = word.size();
bool change = false;
while (!curLevel.empty() || !nextLevel.empty())
{
if (find)
break;
if (curLevel.empty() && !nextLevel.empty())
{
curLevel.swap(nextLevel);
}
word = curLevel.front();
curLevel.pop();
if (word == end)
break;
for (int i = 0; i < n; i++)
{
string tmp = word;
for (int j = 0; j < 26; j++)
{
char tc = 'a' + j;
if (word[i] != tc)
{
tmp[i] = tc;
if (dict.find(tmp) != dict.end() || tmp == end)
{
nextLevel.push(tmp);
if (tmp == end)
{
find = true;
break;
}
dict.erase(tmp);
change = true;
}
}
}
//
if (change)
{
}
}
if (nextLevel.size() > 0)
{
int m = nextLevel.size();
queue tmpNext;
if (m > 1)
{
int oResSize = res.size();
for (int mm = 1; mm < m; mm++)
{
for (int k = 0; k < oResSize; k++)
{
res.insert(res.begin() + k, res[k]);
}
}
}

//res.insert(res.begin(),res.begin(),res.end());
for (int k = 0; k < res.size(); k++)
{
if (res[k].back() == word)
{
string tmp = nextLevel.front();
nextLevel.pop();
res[k].push_back(tmp);
tmpNext.push(tmp);
}
}
nextLevel = tmpNext;
}
}
if (!find) return empty;
else
{
for (int k = 0; k < res.size(); k++)
{
if (res[k].back() != end)
res.erase(res.begin() + k);
}
return res;
}
avatar
r*e
17
这道题15分钟写完倒是可能会挂掉——必然是做过的。15分钟都很难讲清楚。
avatar
x*a
18
一看到用queue就必定是错的。
要用unordered_set。理由自己好好想一想。

【在 a***e 的大作中提到】
: 写了很久都过不了,15分钟哪里能写完啊?能把思路说清楚就不错了。不知道什么样的
: 公司和面试官会出这种题。
: https://oj.leetcode.com/problems/word-ladder-ii/
: vector> findLadders(string start, string end, unordered_set<
: string> &dict) {
: vector> res;
: vector> empty;
: queue curLevel;
: queue nextLevel;
: vector path;

avatar
h*k
19
据说某E开头公司onsite面过
avatar
s*x
20
Break to small functions and write the most important ones first.
avatar
k*a
21
有人知道word ladder II的时间复杂度吗?
谢谢!
avatar
r*e
22
O(size*length*26)
你LinkedIn有下文么?

【在 k*******a 的大作中提到】
: 有人知道word ladder II的时间复杂度吗?
: 谢谢!

avatar
k*a
23
挂了

【在 r*******e 的大作中提到】
: O(size*length*26)
: 你LinkedIn有下文么?

avatar
s*r
24
面ebay的时候问过。写出来了,但还是悲剧,有两轮印度面试官
avatar
J*o
25
今天刚做这题。。。真的有人面试中遇到啊。。。
avatar
m*m
26
amazon onsite 遇到了,估计是bar raiser。 做了个差不多。又被问了几个follow up
问题。也都答上来了。
可惜其余几面的烙印还给了LRU Cache 和 Tiny URL。最后挂了。
avatar
r*d
27
这个题目感觉很麻烦啊
思路:先把词典建立一个无向图。节点为单词。如果两个单词只差一个字母就用边连起
来。
再把start跟end 加入图中算出两点之间所有路径。
这个题目最优的思路是什么啊?
avatar
p*g
28
这题思路先用word ladder 1的bfs找到所有可能性, 再用dfs打印所有可能性
感觉这题都算简单题了, 如果不变种的话
avatar
p*9
29
有的
avatar
f*k
30
遇到过
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。