Find Min Diff Leetcode Javascript Practice