呼唤远方
这种逻辑?vararr=[1,2,5,6,7,11,14];varlen=arr.length,before=arr[0],i=1,res=[],result=[],current;for(;i
互换的青春
这样行吗?functionsubsequence(arr){if(!arr||arr.length1){result.push(subArr);}returnresult;}//testconsole.log(subsequence([]));console.log(subsequence([0]));console.log(subsequence([1,2,5,6,7,11,14]));console.log(subsequence([1,2,3,4,7,8,9,11,23,45,56,66,67]));console.log(subsequence([9,8,7,7,8,9,0]));