EPIJudge
EPIJudge copied to clipboard
Ambiguous problem statement for Search in two Sorted Arrays
You are given two sorted arrays and a positive integer k. Design an algorithm for computing the kth smallest element in an array consisting of the elements of the initial two arrays arranged in sorted order. Array elements may be duplicated within and across the input arrays.
The problem statement doesn't specify if it should be kth smallest distinct element or kth element in combined sorted order of two arrays. For me the last statement makes it lean more towards kth smallest distinct element by mentioning presence of duplicates across two arrays.
Also the file name should be KthSmallestElementInTwoSortedArrays and not KthLargestElementInTwoSortedArrays
Hi @zorro786 ,
About the file name issue, you are right that I just renamed it accordingly.
Conventionally, without explicitly specified distinct, kth element is pretty straightforward. I am surprised that mentioning arrays might have duplicates will cause confusions but we will look at that to see how could we either removing that or reword in a way to make it more clear.