摘要:
本来以为是一道水题,结果居然能从n^2, n*log(n)一直优化到n。感慨啊~O(n^2): 暴力public class Solution { public int[] twoSum(int[] numbers, int target) { // Start typing your Java solution below // DO NOT write main() function int[] r = new int[2]; for (int i = 0; i l) { if (sum > targe... 阅读全文