hello sir, how can we solve this question...
Given a sentence, write a program to arrange and print the words in the sentence such that the last letter of the previous word is same as the first letter of the next word.
Sample Input - educated yielding dedication mediocre nationality
Sample Output - mediocre educated dedication nationality yielding
Above solution is for the same problem. Please give it a try first and let me know if you face any problem.
It´s showing "program timed out.
Please check your code for infinite loop"
It will show timeout if you do not provide console input as expected- input sentence should contain the words which start with the other's word trailing letter. Just write a sentence with same convention and press enter after executing the program.
You can try this solution i just posted without while loop.