top of page

Find-closest-values-in-list-python

seidetepervi
Assume this is a list: a = [5,6,6,7,1,2,10,15,7,6] and here another list b = [1.5,2.5] I want to get the closest value from a based on b: answer = …












find-closest-values-in-list-python


Given a sorted array, two integers k and x, find the k closest elements to x in the array. ... The value k is positive and will always be smaller than the length of the sorted array. ... For space complexity, it uses O(k) space for saving result list. 939c2ea5af





2 views0 comments

Recent Posts

See All

Comments


Subscribe for updates

Management & Booking

 

500 Terry Francois Street

San Francisco, CA 94158

info@mysite.com

© 2023 by The Silent South. Proudly created with Wix.com

bottom of page