Convert multiple recursive calls into tail-recursion
问题 Just wondering if a function like this can be done tail-recursively. I find it quite difficult because it calls itself twice. Here is my non-tail-recursive implementation in javascript. (Yes I know most javascript engine doesn't support TCO, but this is just for theory.) The goal is to find all sublists of a certain length(size) of a given array(arr). Ex: getSublistsWithFixedSize([1,2,3] ,2) returns [[1,2], [1,3], [2,3]] function getSublistsWithFixedSize(arr, size) { if(size === 0) { return [