avatar
interview question# Java - 爪哇娇娃
r*o
1
精华区找不到了
H & J Auto Repair
7511 Chapman Ave
Garden Grove, CA 92841
Phone: (714) 890-1336
老板人很实在,好像是最早期出来留学的那波人,不过后来自己开铺子修车了。价钱不
是死便宜的那种,但是绝对不会玩花样坑你。俺老汉以前车子坏了再那修要过夜等配件
,老板就把他的lexus借给俺开回家了,做人很厚到。
如果是周六去的话要趁早,他那儿生意太好了。
avatar
m*a
2
there are 2 integer arrays a and b ;
how do find the intersection of these two arrays and keep the order of array
a?
Has any one posted this question before?
avatar
s*y
3
Build a HashMap using b,
Loop through a, check if element is in the HashMap
avatar
m*a
4
Thanks. then how do you handle the repeat of elements?
say; A { 1,5, 5, 8 , 7,6,5}
B: {2, 3, 5, 5, 9,22,7}
avatar
g*g
5
Use hashset

【在 m*****a 的大作中提到】
: Thanks. then how do you handle the repeat of elements?
: say; A { 1,5, 5, 8 , 7,6,5}
: B: {2, 3, 5, 5, 9,22,7}

avatar
Z*e
6
when you build HashMap with B, let the key be elements in B, value be its
number of duplications
when you scan A, reduce the number of duplication in map when you find a
match and remove it from HashMap when it's zero

【在 m*****a 的大作中提到】
: Thanks. then how do you handle the repeat of elements?
: say; A { 1,5, 5, 8 , 7,6,5}
: B: {2, 3, 5, 5, 9,22,7}

avatar
m*a
7
thanks, all.
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。