Good day. I was searching for how to list all possible combinations of numbers 1 to n taken k numbers. I cam across some algorithms and recursive methods. But I am fairly new to coding so I have a hard time understanding complex codes. Can someone tell me a way I can think of this problem so that I can put it into code? I am not allowed to use intertools so I may have to do an iterative or recursive version.
all_combination(3 , 2)
should return
[[1,2],[1,3],[2,3]]