GoalScope — binary_search_rightmost (Qwen2.5-Coder-32B-Instruct) — hover a token to see the patched verbalization
<code>↵ def binary_search_rightmost(arr, target):↵ """Binary search for the rightmost occurrence of target in arr."""↵ left, right = 0, len(arr) - 1 result = -1 while left <= right:↵ mid = (left + right) // 2 if arr[mid] == target:↵ result = mid left = mid + 1 elif arr[mid] < target:↵ left = mid + 1 else:↵ right = mid - 1 return result</code>