Help me with a string problem

Revision en1, by PUSSY_LICKING_LOLI_69, 2024-09-14 04:13:54

A classmate came up with a problem and challenged me to solve it, but he is not sure if this problem is even solvable or not, and I haven't figure out a solution.

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 PUSSY_LICKING_LOLI_69 2024-09-14 04:55:37 163
en1 English PUSSY_LICKING_LOLI_69 2024-09-14 04:13:54 559 Initial revision (published)