Please help in need :') C program A king sends out two scrolls to the common public with the encryted message in it. the hidden message is the no of days the king is going to declare a war in. u have to interpret the encryption technique from the example4s given below and find the no of days. write a program which inputs the two messages and gives the no of days as output. For example. Scroll 1 : AMAZAPPLE Scroll 2 : APPLIECATION Hidden message : 5 Scroll 1 : APPLEPIE Scroll 2 :LEPIECT Hidden message : 5 It is the no of words common in a stretch
@wio please help pleaseeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
..............yeah I'm retard...I can't help ya here :/ Sorry
Is "APPLIECATION" meant to be APPLEICATION
No. of words common in a stretch means the longest common string. For example, "EXAMple" and " EXAMination" has a common string of length four. They don't have to start at the beginning. Or, "reSTRIct" and "STRIke" have again a common string of length four. These are easier to look for by inspection because of the short length. You need an algorithm to look for common strings of lengths in the hundreds, for example binary strings. @rvc Does that answer the question?
No please help me with program
Do you have an algorithm? If you have, please post the algorithm before working on the program.
no
Have you done trees?... and dynamic programming?
yes please tell me the logic to compare the strings
First thing first, do you understand the problem?
yes
Good, if you have done trees and dynamic programming, you can start by taking a look at the algorithm suggest in the following link: https://en.wikipedia.org/wiki/Longest_common_substring_problem
okay thank you so much
You're welcome! :)
Join our real-time social learning platform and learn together with your friends!