一道M$算法题。# JobHunting - 待字闺中
H*7
1 楼
Consider array of INT of positive numbers:
{1,3,6,4,7,6,9,2,6,6,6,6,8}
Given: only one number is repeated, return number and positions with
efficient algorithm.
Any ideas for efficient algorithms?
如果用hash map的话,怎么维护indices? 因为需要返回positions...any thoughts?
{1,3,6,4,7,6,9,2,6,6,6,6,8}
Given: only one number is repeated, return number and positions with
efficient algorithm.
Any ideas for efficient algorithms?
如果用hash map的话,怎么维护indices? 因为需要返回positions...any thoughts?