G
Guest
Hi,
Anyone know how I can do this?
I will pay anyone via PayPal who can do this for me. Let me know?
Write a function in C# that takes in an array of ASCII strings and finds all
common character sequences. A common character sequence is defined as 3 or
more adjacent characters that appear in more than one string in the array.
Use the following function signature for your response:
//C#
class FoundString {
public int cOccurrences; //count of times this substring
//occurred in the value array
public string szSubstring; //substring that was found
}
FoundString[] countSubstrings(string[] rgszValues);
Ex. input of ("will-01", "a_williams", "will_01_iam") would return
"wil" (cOccurrences = 3)
"will" (cOccurrences = 3)
"ill" (cOccurrences = 3)
"iam" (cOccurrences = 2)
Provide coded unit tests cases that exercise your solution.
For extra credit:
1a. Order the results in descending order based on the number of input
values each sequence matched.
1b. Prune the results by removing all results that are a substring of
another result that matched the same number of input values. In the above
example "wil" and "ill" would both be discarded because they are both a
substring of "will" and all 3 values match 3 input strings
Anyone know how I can do this?
I will pay anyone via PayPal who can do this for me. Let me know?
Write a function in C# that takes in an array of ASCII strings and finds all
common character sequences. A common character sequence is defined as 3 or
more adjacent characters that appear in more than one string in the array.
Use the following function signature for your response:
//C#
class FoundString {
public int cOccurrences; //count of times this substring
//occurred in the value array
public string szSubstring; //substring that was found
}
FoundString[] countSubstrings(string[] rgszValues);
Ex. input of ("will-01", "a_williams", "will_01_iam") would return
"wil" (cOccurrences = 3)
"will" (cOccurrences = 3)
"ill" (cOccurrences = 3)
"iam" (cOccurrences = 2)
Provide coded unit tests cases that exercise your solution.
For extra credit:
1a. Order the results in descending order based on the number of input
values each sequence matched.
1b. Prune the results by removing all results that are a substring of
another result that matched the same number of input values. In the above
example "wil" and "ill" would both be discarded because they are both a
substring of "will" and all 3 values match 3 input strings