Input: "hello python program how are you" Output: are hello how program python you Input: "Coders loves the algorithms" Output: Coders algorithms loves the
Note: words that have the first letter are capital letters and will be printed in alphabetical order.
The approach used in this program is very simple. Split the lines using the split () function. After that, sort the words in lexicographic order using sort (). Repeat words in a loop and print each word that is already sorted.
alphabetical example hello how in is manner sort the this to word