Given k sorted arrays, select one element from each array such that the difference of maximum and minimum element of the selected elements is minimum

前端 未结 2 1042
抹茶落季
抹茶落季 2021-01-16 03:42

Given k sorted arrays, select one element from each array such that the difference of maximum element and minimum element of the selected elements is minimum. Example for k

相关标签:
2条回答
  • 2021-01-16 04:34

    Shortest range in k sorted arrays/lists is the standard problem you are looking for, here is it's solution.

    0 讨论(0)
  • 2021-01-16 04:42

    May be you are looking for this answer : https://www.geeksforgeeks.org/find-smallest-range-containing-elements-from-k-lists/ .
    It's not contributed to me, I just found this on geeksforgeeks while searching for the same thing as you.

    0 讨论(0)
提交回复
热议问题