l*f 发帖数: 218 | 1 给定一个array和一个integer,问找一种O(n)的算法来确定array里是否有两个数的和
是给定的那个integer
想半天没想出来 | g********d 发帖数: 203 | | t****a 发帖数: 1212 | | x*****p 发帖数: 1707 | 4 You can use hashmap, but need to remove the case that half of the target sum
appears twice in the array. | g*******y 发帖数: 2114 | 5 后续是3个数,4个数的和等于给定的integer
【在 l*f 的大作中提到】 : 给定一个array和一个integer,问找一种O(n)的算法来确定array里是否有两个数的和 : 是给定的那个integer : 想半天没想出来
|
|