What, do you guys think, is the best way to arrange 7 aribtrary letters in all of thier combinations and enter them into an array or compare them to an array.

i want to loop through each of these combinations, and then compare it to an array of 4000 elements to see if there are any matches

P.S. there are 8031810176 combinations