Last Updated: 7 Mar, 2021
##### Split Concatenated String
Moderate
Problem statement

#### String xβ=βx1x2... x|x| is lexicographically larger than string yβ=βy1y2... y|y|, if either |x|β>β|y| and x1β=βy1,βx2β=βy2,β...,βx|y|β=βy|y|, or exists such number r (rβ<β|x|,βrβ<β|y|), that x1β=βy1,βx2β=βy2,β...,βxrβ=βyr and xrβ+β1β>βyrβ+β1.

##### Input Format :
``````The first line of input contains an integer βTβ denoting the number of test cases.

The next β2Tβ lines represent the βTβ test cases.

The first line of each test case contains one integers βNβ denoting the number of strings.

The second line contains N space-separated strings.
``````
##### Output Format :
``````For each test case print the lexicographically biggest string.
``````
##### Constraints :
``````1 <= T <= 50
1 <= N <= 100
1 <= length of string(si) <= 100  for all  1 <= i < = n

Time Limit: 1sec
``````
Approaches

## 01Approach

The key idea is to first check for all strings that if str[i]<reverse(str[i]) then replace str[i] by reverse(str[i]).After this split the concatenated string about all the  character of the string.

Algorithm :

• First check for all strings that if str[i] <reverse(str[i]) then replace str[i] by reverse(str[i]).
• After iterating through all strings and for all strings iterate through its characters.
• For the jth character of string spit about this point.After splitting the given string will be temp=((j to len -1) characters of ith string) +( i+1 to n strings)+(0 to i-1 strings).
• If the temp is greater than ans then ans=temp
• In the end, return the ans string