Question
Rearrange an integer list into the next larger lexicographic arrangement, wrapping around to the smallest arrangement when no larger one exists. ```python def solve(raw: str) -> str: ... ``` ## Requirements - Line 1 holds the length `n`. Line 2 holds `n` integers separated by spaces. - Compare arrangements position by position from the left. The next arrangement is the smallest arrangement strictly greater than the current one. - Duplicate values are allowed. - If the current arrangement is already the largest, return the smallest arrangement, with values in ascending order. - Print the resulting list in one space-separated line, keeping the same length and the same multiset of values. - `run_case(case: dict)` forwards `case["stdin"]` to `solve`. - Do not append a trailing newline to the returned string; return the value exactly once.