Implement the functionality to find the largest "beautiful number" that can be generated from the given input string representation of a number. A beautiful number is defined as a number where all digits appear an even number of times, except for at most one digit which can appear an odd number of times.
Functionality
Function Signature:
Implement the function find_largest_beautiful_number(s: str) -> str in a file called /app/solution.py.
Input Requirements:
The input s is a string of digits (0-9) representing a non-negative integer. The length of the string can be up to 100 characters.
Output Requirements:
The function should return a string that represents the largest possible beautiful number that can be formed by rearranging and modifying the digits of the input string. If no beautiful number can be formed, return an empty string.
Examples
Example 1:
Input: "123"
Output: "2"
Example 2:
Input: "55555"
Output: "5555" (since one '5' remains to ensure the rest have even parity)
Example 3:
Input: "000"
Output: "0" (zero is considered a valid beautiful number)
Example 4:
Input: "4321"
Output: "42" (the largest beautiful number that can be formed)
Implementation Guidelines
Ensure that the function appropriately manipulates the digits of the input string to form the largest possible beautiful number while adhering to the stipulated constraints of digit frequency.
The output must be the maximal number and follow the rules of being a beautiful number as defined above.
Once implemented, the solution should handle edge cases and return results quickly even for the maximum input size.