Company: Amazon_3_Jan
Difficulty: medium
Lexicographically Maximal Transformation Problem Description You are given a binary string, shipmentData . You can reorder the characters of this string to form any permutation. Each permutation is called a "configuration". For each configuration, you must generate a finalSequence by following a specific transformation process: Initialize an empty string, let's call it temp . Iterate through the characters of the configuration string from left to right (from index i = 0 to n-1 ). For each character c at index i : Append c to the end of temp . Reverse the entire string temp . After the loop finishes, the resulting string temp is the finalSequence . Your task is to find the configuration of shipmentData that results in the lexicographically largest possible finalSequence . You should return this optimal configuration. Note on Lexicographical Comparison: A string a is considered lexicographically larger than a string b if either of the following conditions is satisfied: b is a prefix of a