取一半计算
和为S的连续正数序列
http://www.nowcoder.com/questionTerminal/c451a3fd84b64cb19485dad758a55ebe
暴力呗 取一半就行
import java.util.ArrayList;
public class Solution {
public ArrayList<ArrayList<Integer> > FindContinuousSequence(int sum) {
ArrayList<ArrayList<Integer> > result = new ArrayList<ArrayList<Integer> >();
if (sum<3) {
return result;
}
for(int i =1;i<(sum+1)/2;i++) {
ArrayList<Integer> temp = new ArrayList<Integer>();
int cur = 0;
int j = i;
while(cur<sum) {
temp.add(j);
cur+=j;
j+=1;
}
if(cur ==sum) {
result.add(temp);
}
}
return result;
}
}

