I have been trying to make a program that runs over a dictionary which makes anagrams from an inputted string. I found most of the code to this problem here Algorithm to generate anagrams but i need to have the program only output a line of max amount of words instead of only using words of a set length (MIN_WORD_SIZE).
If the input was: python Anagram.py "Finding Anagrams" 3 dictionary.txt. The output would be "Gaming fans nadir" because it only uses 3 words at most to create the anagram. ?