leetcode1237】的更多相关文章

date: 2015-09-09 20:20:58 Two Sum Given an array of integers, find two numbers such that they add up to a specific target number. The function twoSum should return indices of the two numbers such that they add up to the target, where index1 must be l…
题目 给定方程f和值z,找出给定方程f(x,y)=z的正整数解x,y.f(x,y)关于x.y都是严格单调的. 题目保证 f(x, y) == z 的解处于 1 <= x, y <= 1000 的范围内. 方案 暴力双层循环O(N*N) 暴力,双层循环遍历,由于f是单调的,所以一旦遇到大于,则break.同样遇到等于,也可以加入结果并break.时间复杂度O(N*N),N是最大值1000. public List<List<Integer>> findSolution(C…