write a program that:
- reads provided inputs containing alphabetically sorted words list (one word per line, no spaces, all lower case)
- output the following things 2.1 longest compounded word 2.2 second longest compounded word
NOTE :: a compounded word is one that can be constructed by combining (concatenating) shorter words also found in the same test-case input file :: small word list, consisting following words cat cats catsdogcats catxdogcatsrat dog dogcatsdog hippopotamuses rat ratcatdogcat
ANSWERS:: longest compounded word :: ratcatdogcat second longest compounded word :: catsdogcats constraint 1<=N<=10^8
please provide me the solutions and time complexity with explanation i hope all off you reply this question comes in GOOGLE in open book assignment conducted in IIT mandi love you all