You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You are given two strings 'S' and 'T' of length 'N' and 'M'. You are creating an infinite length sequence by concatenating 'S' and 'T' in the following order:
The sequence would look like: " S + S + T + T + S + S + T + T ... "
Here, two copies of 'S' and 'T' are concatenating in an alternating order.
You are also given an integer 'X'. You have to find the 'Xth' character of the given sequence by considering '0' based indexing.
Your task is to find the 'Xth' character of the given sequence and return it.
Example:
N = 3
M = 2
S = 'abc'
T = 'xy'
X = 9
he final sequence would look like: "abcabcxyxyabcabc...