Back to problems

K-th Unique Maximum from Two Sorted Arrays

Algorithm · SoFi · Medium

Problem: K-th Distinct Largest Value from Two Sorted Arrays You are given two integer arrays, A and B, each arranged in ascending order and possibly containing repeated values, along with an integer K. Determine the K-th value among all distinct elements in $$A \cup B$$ when those values are sorted from greatest to least. A value contributes just one position, regardless of how many times it occurs within either array or across both arrays. Return None (or output null) when…

Checking your access…