what computer language -- e.g. c++, c, vb, java, assembly, cobol, fortran, etc. etc.
Ancient Dragon
Achieved Level 70
32,109 posts since Aug 2005
Reputation Points: 5,836
Solved Threads: 2,575
Skill Endorsements: 68
write a function that returns true of false that indicates if one string is contained in another string. For example if "hello" is contained in "hello world". You can call that function as many times as you wish. If you have two strings "hello" and "world" call the function for each word to find out whether or not they are contained in a third string "hello world".
Ancient Dragon
Achieved Level 70
32,109 posts since Aug 2005
Reputation Points: 5,836
Solved Threads: 2,575
Skill Endorsements: 68
For example, the strings abac and bbc occur interwoven in cabcbabdcca (cabcbabdcca) along with other characters (in black).
The color doesn't show up so I am not sure what you mean by "interwoven"? Please give a better example or try to add ASCII visual instead.
Taywin
Posting Maven
2,633 posts since Apr 2010
Reputation Points: 275
Solved Threads: 375
Skill Endorsements: 17
No, I don't understand the word "computer biological." But if it is similar to a DNA sequence (as 'abc' is a molecule sequence consists of a, b, and c), then I understand what it is. However, when you use the word "interwoven," and said you have added color to the display, I am not sure how you want the result to be?
By the way, a computer language is trivia in your case but algorithm is. In this case, it is not that easy when there is a possibility of multiple appearances of substring in a string. If a brute force algorithm is suffice, then it would not be too difficult.
//i.e.
//String T = "cabcbabdcca";
//String u = "abac";
//String v = "bbc";
//Result of scanning string u in T | Result of scanning string v in T
// cabcbabdcca | cabcbabdcca
// 12 3 4 | 12 3
// cabcbabdcca | cabcbabdcca
// 12 3 4 | 12 3
// cabcbabdcca | cabcbabdcca
// 1 23 4 | 1 23
// cabcbabdcca | cabcbabdcca
// 1 23 4 | 1 23
// | cabcbabdcca
// | 1 23
Taywin
Posting Maven
2,633 posts since Apr 2010
Reputation Points: 275
Solved Threads: 375
Skill Endorsements: 17