We're given two strings, ABCDEFGHIJKLMNOPQRSTUVWXYZ
).
If a character at index
Here is a visual example of a string crossing:
G
O
HELLOWORLD
D
B
Y
E
You are allowed to modify up to one character in string
Your job is to determine the maximum number of string crossings after modifying up to one character in string
Constraints
For this problem, you will NOT be required to pass all the samples to receive points, and you are NOT required to pass all previous subtasks to receive points for a specific subtask.
Subtask 1 [6/15]
Subtask 2 [4/15]
A
and B
.
Subtask 3 [5/15]
No additional constraints.
Input Specification
The first line will contain
The second line will contain
The third and final line will contain
Output Specification
Output one integer on one line, the maximum number of string crossings after modifying up to one character in string
Sample Input
10 7
HELLOWORLD
GOODBYE
Sample Output
9
Explanation
Without any modifications, we can count
If we change the Y
in GOODBYE
to an L
, we can now count
Comments