6 kyu
Unique Substring From Joined Strings
134 of 256obnounce
Description:
Write a function that takes two strings, A and B, and returns the length of the longest possible substring that can be formed from the concatenation of either A + B or B + A containing only characters that do not appear in both A and B.
Example:
Given the strings "piquancy" and "refocusing":
A = "piquancy"
B = "refocusing"
A + B = "piquancyrefocusing"
B + A = "refocusingpiquancy"
Since 'i', 'n', 'u', and 'c' appear in both A and B, all acceptable substrings without those characters are:
"p", "q", "a", "yrefo", "s", "g" (from A + B)
"refo", "s", "gp", "q", "a", "y" (from B + A)
Therefore, it would be correct to return 5: the length of "yrefo".
Strings
Arrays
Algorithms
Similar Kata:
Stats:
Created | Jul 3, 2016 |
Published | Jul 3, 2016 |
Warriors Trained | 735 |
Total Skips | 52 |
Total Code Submissions | 2859 |
Total Times Completed | 256 |
Java Completions | 134 |
Ruby Completions | 63 |
Swift Completions | 65 |
Total Stars | 17 |
% of votes with a positive feedback rating | 91% of 71 |
Total "Very Satisfied" Votes | 61 |
Total "Somewhat Satisfied" Votes | 7 |
Total "Not Satisfied" Votes | 3 |
Total Rank Assessments | 10 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 5 kyu |
Lowest Assessed Rank | 7 kyu |