<prompt> Una orodha k za nambari kamili zilizopangwa katika mpangilio usiopungua. Tafuta safu ya ndogo zaidi inayojumuisha angalau nambari moja kutoka kwa kila orodha ya k.Tunafafanua safu a, b ni ndogo kuliko safu c, d ikiwa b - a d - c au a c ikiwa b - a d - c.Mfano wa 1:Ingizo: nambari 4,10,15,24,26,0,9,12,20,5,18,22,30Pato: 20,24Maelezo:Orodha ya 1: 4, 10, 15, 24,26, 24 iko katika safu 20,24.Orodha ya 2: 0, 9, 12, 20, 20 iko katika safu 20,24.Orodha ya 3: 5, 18, 22, 30, 22 iko katika safu 20,24.Mfano wa 2:Ingizo: nambari 1,2,3,1,2,3,1,2,3Pato: 1,1Vikwazo: nums.length k 1 k 3500 1 numsi.urefu 50 -105 numsij 105 Numsi imepangwa katika mpangilio usiopungua.  <response>: kuagiza rundodef smallestRangeidadi: minHeap maxVal -1e9 kwa mimi, lst katika kuhesabunambari: heapq.heappushminHeap, lst0, i maxVal maxmaxVal, lst0 listIndices 0 leninambari minRange 1e9 kuanza, mwisho -1, -1 wakati lenminHeap lennambari: val, listIdx heapq.heappopminHeap range_ maxVal - val ikiwa safu_ minRange: minRange masafa_ kuanza, mwisho val, maxVal listIndiceslistIdx 1 ikiwa listIndiceslistIdx lennumslistIdx: newVal numslistIdxlistIndiceslistIdx heapq.heappushminHeap, newVal, listIdx maxVal maxmaxVal, newVal kurudi anza, mwisho 