Given an array contains N numbers of 0 .. N, find which number doesn’t exist in the array.
Example :
Given N = 3 and the array [0, 1, 3], return 2.
first solution
|
|
set集合不能通过索引进行查找对象,只能通过pop
九章算法
|
|
Given an array contains N numbers of 0 .. N, find which number doesn’t exist in the array.
Example :
Given N = 3 and the array [0, 1, 3], return 2.
|
|
set集合不能通过索引进行查找对象,只能通过pop
|
|
近期评论