I have my user input input in the form of nested list. I want to make combinations out of it and it's like as follows:
Input: [[1, 2, 3],
[4, 5, 6],
[7, 8, 9]]
Zipping it using zip function in python so that traversing would be easy.
Zipped Output [(1, 4, 7), (2, 5, 8), (3, 6, 9)]
Tree structure to be traversed ex:
1
/ | \
2 5 8
/ | \ /| \ / | \
3 6 9 3 6 9 3 6 9
Expected ouput
1,2,3
1,2,6
1,2,9
1,5,3
1,5,6
1,5,9
...
...
7,8,9
I'm not getting how to achieve such combinations using dictionaries or maps or if there is other way to do this please suggest.