Leetcode 1306 Solution
This article provides solution to leetcode question 1306 (minimum-absolute-difference)
Access this page by simply typing in "lcs 1306" in your browser address bar if you have bunnylol configured.
Leetcode Question Link
class Solution: def minimumAbsDifference(self, arr: List[int]) -> List[List[int]]: arr.sort() ans =  curr_dist = sys.maxsize for i in range(len(arr) - 1): dist = arr[i + 1] - arr[i] if dist == curr_dist: ans.append((arr[i], arr[i + 1])) elif dist < curr_dist: curr_dist = dist ans = [(arr[i], arr[i + 1])] return ans