Loading [MathJax]/jax/output/HTML-CSS/fonts/TeX/fontdata.js

Help me with a string problem

Revision en2, by tacocat, 2024-09-14 04:55:37

Given 2 strings A and B, count how many DIFFERENT strings that can be created by combining a prefix of A and a prefix of B (the prefix of A is written first, then the prefix of B)

Constraints:

|A|,|B|<=1e5

both strings only have ASCII characters from a to z

can some one come up with a solution, I would really appreciate it :D

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English tacocat 2024-09-14 04:55:37 163
en1 English tacocat 2024-09-14 04:13:54 559 Initial revision (published)