0
I have written this snippet to find k-permutations of n, i.e. if i have an array of n=3 {0,1,2}, then k=2 permutations will be {{0, 1}, {0, 2}, {1, 0}, {1, 2}, {2, 0}, {2, 1}}.
Can somebody review it and help me optimize / reduce its complexity (I don't want to use recursive function):
"_getAllP...