โ† Morgan Stanley questions

Count unique strings after substring replacement

Filed under Morgan Stanley

The question

Given two strings A and B of the same length, you can replace any substring A(i,j) with B(i,j). Calculate the total number of unique strings that can be formed.

No write-up yet. Related questions below have one.

Related Morgan Stanley questions

Collected from public candidate posts and coding forums. Updated Nov 2026.