Reminder: in case of any technical issues, you can use the lightweight website m1.codeforces.com, m2.codeforces.com, m3.codeforces.com. ×

ss_96's blog

By ss_96, history, 21 month(s) ago, In English,

Given a corrupted string i.e it’s original string with just the spaces at wrong places, Construct the original string .We are given a dictionary of words.

Ex:-

input string : Com put erengineering

original string(output): Computer Engineering

I am trying to solve this with recursion and read these dictionary involving questions in many interview experiences but couldn't figure out the recursive equation,can anyone please provide some pseudo-code or some reference link for this problem?

Thank you for your time.

 
 
 
 
  • Vote: I like it
  • 0
  • Vote: I do not like it

»
21 month(s) ago, # |
  Vote: I like it +10 Vote: I do not like it
  • »
    »
    21 month(s) ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Thanks for the link.I have seen this problem,thought there might be a simpler recursive solution.