Please read the new rule regarding the restriction on the use of AI tools. ×

1726's blog

By 1726, history, 11 months ago, In English

Given a string S1 of length L1 consisting of Latin uppercase alphabets only and a string S2 of length L2 consisting of characters 'T'and 'F' only. Generate a lexicographically smallest string S of length (L1 + L2 - 1) such that a substring of length L1 in string S starting at index i (0 ≤ i < L2) is equal to S1 if and only if ith element of 52 is 'T (without quotes) else not. If no such string can be generated, print "-1" (without quotes). Notes A string a is lexicographically smaller than a string b if and only if one of the following holds: • a is a prefix of b, but a ‡ b; • in the first position where a and b differ, the string a has a letter that appears earlier in the alphabet than the corresponding letter in b. Find the lexicographically smallest string S which satisfies the given condition. Function description

  • Vote: I like it
  • +5
  • Vote: I do not like it

»
11 months ago, # |
  Vote: I like it -6 Vote: I do not like it

Just skip to next problem???