Infinite Replacement Codeforces Solution | Codeforces Problem Solution 2022
You are given a string , consisting only of Latin letters 'a', and a string , consisting of lowercase Latin letters.
In one move, you can replace any letter 'a' in the string with a string . Note that after the replacement string might contain letters other than 'a'.
You can perform an arbitrary number of moves (including zero). How many different strings can you obtain? Print the number, or report that it is infinitely large.
Two strings are considered different if they have different length, or they differ at some index.
The first line contains a single integer () — the number of testcases.
The first line of each testcase contains a non-empty string , consisting only of Latin letters 'a'. The length of doesn't exceed .
The second line contains a non-empty string , consisting of lowercase Latin letters. The length of doesn't exceed .
No comments:
Post a Comment