Word puzzle solver in java using hash tables