I think the best way is you prepare the list of words then remove the duplicated letters, until you have the 5 letters remaining for each level.
Example :
List of words = "APPLE-EGG-GAP-PEA-LEG"
Letters = "P,A,E,L,G"
It will cost your time but you can control it better.