[Go] Binary search solution
\nfunc findClosestElements(arr []int, k int, x int) []int {\n\tleft, right := 0, len(arr)-k\n\tfor left < right {\n\t\tmid := (left+right)/2\n\t\tif x - arr[mid
```\nfunc findClosestElements(arr []int, k int, x int) []int {\n\tleft, right := 0, len(arr)-k\n\tfor left < right {\n\t\tmid := (left+right)/2\n\t\tif x - arr[mid] > arr[mid+k]-x {\n\t\t\tleft = mid + 1\n\t\t} else {\n\t\t\tright = mid\n\t\t}\n\t}\n\treturn arr[left:left+k]\n}\n```
[]