https://en.wikipedia.org/wiki/Leibniz_formula_for_determinants
https://en.wikipedia.org/wiki/Heap's_algorithm
#Reference1: Code refers to heap pseudo-algorithm from wikipedia
https://en.wikipedia.org/wiki/Heap%27s_algorithm#Details_of_the_algorithm
#Reference2: Research paper on analysis at all the permutations algorithm
http://homepage.divms.uiowa.edu/~goodman/22m150.dir/2007/Permutation%20Generation%20Methods.pdf
Where in conclusion, it stated that Heap's algorithm is slightly more effecient and can code faster
#Reference3: I got a better understanding by watching the following video
https://www.youtube.com/watch?v=YMMNgn6qZVA
Note: used bubble sort to count steps (duplicate), could have done better.