I need to visit n consecutive nodes. From every node I can take either path to the Left or path to the Right, leading me to the next node. I would like to get a list of lists of all possible permutations of paths that can lead me from the first node to the last one. So, in case i have two nodes I would like to get:
[[Left,Left],[Left,Right],[Right,Right],[Right,Left]]
I guess I need to use some basic recursive function but I can't quite wrap my head around it.