Question
Given a nondecreasing array and a target value, report where the target first appears, or `-1` when it is missing. A logarithmic search is expected, even though the same value may occur many times. ```python def solve(raw: str) -> str: ... ``` ## Requirements - Line one is the element count `n`. Line two holds the `n` space-separated integers in nondecreasing order, and is empty when `n` is 0. Line three is the target. - Return the smallest zero-based index holding the target, as a decimal string with no padding. - Return `-1` when the array is empty or the target never appears. - Repeated values are expected, so an ordinary equality hit is not enough; after a match keep searching to the left while remembering the best index seen. - Keep the running time logarithmic in `n`. Negative values, a target below the minimum, and a target above the maximum must all work. - `run_case` passes `case["stdin"]` to `solve`. - Do not append a trailing newline to the returned string; return the value exactly once.