Company: Global_foundries_8dec
Difficulty: easy
Sort and Concatenate Substrings You are given N strings of lowercase English letters and one integer L . Each string is processed on its own, independently of the others: Read the string from left to right and cut it into consecutive blocks of L characters. The first block is characters 1..L , the second is L+1..2L , and so on. If the string's length is not a multiple of L , the final block is shorter than L characters. Keep that short block exactly as it is — do not pad it and do not discard it. Sort the blocks of that string into ascending lexicographic order. Concatenate the sorted blocks, in order, into one string. Print the resulting string for each input string, in the order the strings were given. Lexicographic order is ordinary dictionary order on the block strings: compare character by character, and when one block is a proper prefix of another, the shorter one comes first. So with L = 3 the blocks of welcometohome are wel , com , eto , hom , e , and they sort as com , e , eto