I am currently writing code in C++ to find all possible permutations of 6 integers and store the best permutation (i.e. the one whose total is closest to a given value).
I am trying to write this code as efficiently as possible and would apreciate any advice or examples.
I was considering storing the integers in an array and performing the permutations using pointers within a loop. Is this a good approach?