The's ranking pipeline receives two ordered lists of scores. Filter out every even value, then select and merge odd values from both lists to create the lexicographically largest sequence of exactly k values.
The relative order of selected values from each original list must remain unchanged, but values from the two lists may be interleaved. Use a monotonic-stack technique to choose the best subsequence from each list, then merge those subsequences greedily.
Implement max_odd_merge(nums1, nums2, k).
nums1 and nums2, and an integer k.k odd integers, maximized in lexicographic order.def max_odd_merge(nums1, nums2, k):