Блог пользователя FARMAAN_KHANN

Автор FARMAAN_KHANN, история, 13 месяцев назад, По-английски

write a program that:

  1. reads provided inputs containing alphabetically sorted words list (one word per line, no spaces, all lower case)
  2. 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

  • Проголосовать: нравится
  • -43
  • Проголосовать: не нравится