Looking to generate all possible combinations of elements (without repetition) from a given array and length.
For example, with an array of:
arr = ['a','b','c','d']
and a length of 3, the desired output would be a 2-dimensional array like this:
result = [
['a','b','c'],
['b','c','a'],
['c','a','b'],
. . . etc.
]
This task has proven quite challenging for me so far.