func addCombo(prevCombo: [Int], var pivotList: [Int]) -> [([Int], [Int])] { return (0.. ([Int], [Int]) in (prevCombo + [pivotList.removeAtIndex(0)], pivotList) } } func combosOfLength(n: Int, m: Int) -> [[Int]] { return [Int](1...m) .reduce([([Int](), [Int](0..