I\'d like to calculate all the permutations of size Y of a set of size X. That is if I had (1,2,3) and want all permutations of size 2, 3P2, it would be (1,2) (1,3) (2,1) (
I do not exacly get your question about cryptogram. But if you want to find longest permutation (anagram) of this words in your dictionary you can try his way.
a-> first bit, b-> second bit and so on. If you have word in your "ouglg ouyakl" case this mean
abcdefghijklmnopqrstuvxyzabcdefghijklmnopqrstuvxyzabcdefghijklmnop
100000100011001000001001000000010000100100000100000000000000000000
(hope i did not missed something) Now you create same bitmasks for your vocabulary.
And when you chek against vocabulary you just have to do is
vocabulary & ( ouglg_ouyakl ^ vocabulary)
and this trows 0 if your vocabulary word is from ouglg_ouyakl.
About permutations
for each permutation of numbers fom 1-n // that is 1,2 and 2,1
for(i=0;i
EDIT: prevous soluton was inapropriate for 24P7.