Company: Amazon_3oct
Difficulty: medium
Lexicographical String Game Problem Description At Amazon's internal developer summit, two engineers: Alex and Charlie are competing in a fun coding duel challenge. They are given a string S composed of lowercase English letters. The game rules are as follows: Alex and Charlie take turns removing one character at a time, with Alex going first. The game continues until only one character is left in the string. The engineers adopt the following removal strategy: Alex's strategy: Remove a character that results in the smallest possible string (lexicographically). Charlie's strategy: Remove a character that results in the largest possible string (lexicographically). Your task is to simulate this process and determine the final character left in the string after all removals with Alex making the first move. Note: To compare two strings, the lexicographical order is defined as follows: Start by comparing character by character from left to right of the string. The string with the first diffe