Consider the following two player "Road Trip" Game:
player 1 starts with a word w1 (typically country or city); player 2 then names a new word w2 that starts with the last letter of w1. Player 1 then names a new word w3 that starts with the last letter of w2, and so on.
For example, this game might play out as "dortmund", "dominican republic", "canada", "ajax".
Read in the input one line at a time, and output the fewest number of turns it might take for such a game that starts at line 1, ends at line n (where n is the total number of lines in the file) using only lines of the file as the possible words in between. If there is no way to play to get to the last line from the first line, output 0.
For example, the input "dortmund", "bermuda", "canada", "paris", "dominican republic", "ajax" would return 4 ("dortmund" -> "dominican republic" -> "canada" -> "ajax"), whereas the input "dortmund", "bermuda", "canada", "dominican republic", "ajax", "paris" would return 0 since there is no way of playing to get from the first line to the last line, and you want to return the fewest number of turns that do so. Each turn must use a line that is not used on any previous turn, You may assume that each line has at least one character on it, and case matters (so, you do not need to do any fancy changing of letters from upper to lower case or vice-versa.)
Source code files are attached, you only need to modify the [login to view URL] file and the others can be left untouched.
15 freelancere byder i gennemsnit $36 timen for dette job
HI..I am proficient in core Java OO programming with data structures, algorithms including graphs and can help you compete the given project as per requirements.
I have worked on projects similar to this one, I have the ability to finish on time and without mistakes. I'm new to the platform, but that doesn't mean I'm a beginner
Hi! I have a lot of experience with both Java and DS+Algorithms. I'll have this project done in a couple hours or so. EDIT: I've finished and tested the project, and can send it to you as soon as you hire me!
hi I have 10 years of development experience. I am looking for long term engagement with suitable clients. I have worked in data communication , GSM , TCP/IP, HTTP etc in C/C++ ,Erlang ,Java , C# Atul