Previous Question: Spellathon solver in JavaIt has been a while since I asked the above question. I had incorporated most of the comments but I didn't quite get around to review my new implementation. Recap: What is Spellathon?The rules of Spellathon are as follows:Create words that have 4 to 7 letters.Include the centre letter in every word.Form at least one 7-letter word.Plurals are acceptable.The dictionary used is in English.Following is my new implementation:public class Spellathon {    private static HashSet<String> permutations = new HashSet<>();    private static HashSet<String> results = new HashSet<>();    private static char mandatory;    private static void permutation(String str) {        mandatory = str.charAt(0);        permutation(, str);    }    private static void permutation(String prefix, String str) {        int n = str.length();        if (n != 0) {            for (int i = 0; i < n; i++)                permutation(prefix + str.charAt(i), str.substring(0, i) + str.substring(i + 1, n));        }        if(prefix.length() > 3 && prefix.indexOf(mandatory) >= 0) {            permutations.add(prefix);        }    }    public static void main(String[] args) {        if(args.length == 1) {            try{                String input = args[0];                permutation(input.toLowerCase());                Scanner txtscan = new Scanner(new File(/usr/share/dict/words));                while(txtscan.hasNextLine()){                    String cur = txtscan.nextLine().toLowerCase();                    if(permutations.contains(cur)) {                        //System.out.println(Found:  + cur);                        results.add(cur);                    }                }                txtscan = null;                //Displaying results                System.out.println(-------- RESULTS --------);                Iterator<String> itr = results.iterator();                while(itr.hasNext()){                    System.out.println(itr.next());                }                System.out.println(-------------------------);            } catch(Exception e) {                System.out.println(File not found.);            }        } else if (args.length == 0) {            System.out.println(One argument has to be provided.);        } else {            System.out.println(There can only be one argument.);        }    }}One thing that I changed in this implementation is that I now pass the letters as an argument in the command line instead of taking it as an input from the console using Scanner. Another change I made is that I got rid of the repeating words. Now, each unique word is returned only once.Input: Pass the given letters as an argument to the program with the central letter as the first letter. The other letters can be in any order.Output:Previous Sample:$ java Spellathon hleol-------- RESULTS --------holehellohell-------------------------Another Sample:$ java Spellathon ngiilam-------- RESULTS --------gaminlinaminiginanailminglainmainagnimilanalignlimnmailinggainmalignliminglangmaniaimingailinglaming-------------------------I had taken the above example from a newspaper. The solution includes - ailing, aiming, align, gain, laming, liming, ling, MAILING, malign. I got all those in my list except for ling. It seems it isn't in the dictionary (I've confirmed). I checked out the meaning of ling online and it means:any of a number of long-bodied edible marine fishes.the common heather of EurasiaAnyways, any comments/answers on the design and overall correctness of the program will be appreciated.Note: The proper nouns do bug me but I haven't gotten around to solving that problem yet.
Spellathon solver in Java (follow up)
java