I have an array of integers, for example: a[1,2,3]
. I would like to get all possible combinations of these numbers where they don't repeat, possibly with recursion.
I saw something like this done with strings here: Get all combinations without duplicates but don't know how to adapt it to integers without using any standard algorithms.
So I would like something like this as an output: {1},{2},{3},{1,2},{2,3},{1,3},{1,2,3}
Thanks in advance!