Redian新闻
>
buy a pin number for visa appointment
avatar
buy a pin number for visa appointment# Reunion - 探亲与陪读
g*y
1
网上看来的:
一堆数,其中一些数出现了一次,一些数出现了两次,只有一个数出现了三次
找出那个出现了3次的数
hash方法很trivial就不说了。
如果用bitwise operator,怎么高效的做?除了XOR,是不是还得用点别的办法?
avatar
g*p
2
Can I use the chase or citi credit card to buy the pin number for visa
appointment?
Thanks!
avatar
a*e
3
(1) Sorting, time: O(nlogn), space: O(1)
(2) Hashing, time: O(n), space: O(n)
(3) Bitwise operation, How can you use XOR, since after XORing every
elements, both those elements which occur 1 time and the one occurring 3
times will be left indistinguishable?

【在 g*******y 的大作中提到】
: 网上看来的:
: 一堆数,其中一些数出现了一次,一些数出现了两次,只有一个数出现了三次
: 找出那个出现了3次的数
: hash方法很trivial就不说了。
: 如果用bitwise operator,怎么高效的做?除了XOR,是不是还得用点别的办法?

avatar
g*p
4
Do anyone have such experience?
avatar
g*y
5
我也是这样想的。
我觉得更大的可能是,发这个题出来的人,没有理解清楚或者是没有把题讲完整。
不过我还是抱着侥幸心理,万一有某个牛人能够用非常巧妙的方法做出来呢。。。

【在 a*****e 的大作中提到】
: (1) Sorting, time: O(nlogn), space: O(1)
: (2) Hashing, time: O(n), space: O(n)
: (3) Bitwise operation, How can you use XOR, since after XORing every
: elements, both those elements which occur 1 time and the one occurring 3
: times will be left indistinguishable?

avatar
S*a
6
没问题

【在 g*******p 的大作中提到】
: Can I use the chase or citi credit card to buy the pin number for visa
: appointment?
: Thanks!

avatar
f*r
7
try xor with counting approches.
avatar
a*h
8
Use two bit vector.
If two bits are set in both vector, this is the third appearance.
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。