It means that if k=4, then we will consider {1,2,3,4,5,6,7,8}, {1,2,3,4,5,6,8,7},{1,2,3,4,5,7,8,6}, {1,2,3,4,6,7,8,5} and {1,2,3,5,6,7,8,4} cases. As for every case, we need to fix the last element, and then focus on all the permutations of previous 7 elements. Since we already calculated res and sum for the previous step(I mean the step for only having 7 elements), so we can just retrieve information directly from res and sum and update their values.

Sorry, my description is a little confusing. Hope it helps.