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 1064
抹茶落季
抹茶落季 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: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.

提交回复
热议问题