$35
Homework 1-P
Write a program to solve the following search problem: You are given two words of equal length and adictionary of legal English words. At each step, you can change any single letter in the word to any otherletter, provided that the result is a word in the dictionary; you cannot add or remove letters. Your programshould print the shortest list of words that connects the two given words in this way (if there are multiplesuch paths, any one is sufficient).
For testing on the department's Linux machines there is a dictionary at /usr/share/dict/words. Or use thissmaller version)
I/O format
Name your program hw1.(py/java). Your code should take 3 arguments: The dictionary's file name, the startword, and the target word.
You should then print the chain of words that leads from the start word to the target word. Print each word an anewline.
If it impossible find a path then output: "No solution"
You can assume you will be given valid start and target words.
For example:
python3 hw1.py /usr/share/dict/words harp ramp
harp
carp
camp
ramp
Write up
Along with your code, submit the result of searching cold to warm and the results from small to short Putthis in a .txt or .pdf file.
Submission
Zip up your source code and the writup and submit it via mycourses.