52

一个简单的数组面试题

 5 years ago
source link: https://www.v2ex.com/t/480886
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
C/C++/Obj-C - @zmxnv123 - 今天晚上面试,有一个数组的题。一个大小为 n 的数组,数组的内容为 1~n 的任意数,这些数中有一个数出现了 1 次,其他数出现 0 次或多次,怎么在 O(n)时间复杂度,O(1)空间复杂度内找到

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK