Go | 100% speed + mem
\nfunc numMovesStonesII(stones []int) []int {\n\tsort.Ints(stones)\n\treturn []int{minStep(stones),maxStep(stones)}\n}\n\nfunc minStep(stones []int) int {\n\tle
```\nfunc numMovesStonesII(stones []int) []int {\n\tsort.Ints(stones)\n\treturn []int{minStep(stones),maxStep(stones)}\n}\n\nfunc minStep(stones []int) int {\n\tleft,right := 0,1\n\tminStep := math.MaxInt32\n\tgaps := 0\n\texistStones := 1\n\tlength := len(stones)\n\tfor right < length {\n\n\t\tif stones[right] <= stones[left] + length - 1 {\n\t\t\tright++\n\t\t\texistStones++\n\t\t} else {\n\n\t\t\tgaps = length - existStones\n\t\t\tif gaps == 1 && stones[right-1] == stones[left]+length-1 || gaps != 1 {\n\t\t\t\tminStep = min(gaps,minStep)\n\t\t\t}\n\t\t\tleft++\n\t\t\texistStones--\n\n\t\t}\n\n\t}\n\tgaps = length - existStones\n\tif gaps == 1 && stones[right-1] == stones[left]+length-1 || gaps != 1 {\n\t\tminStep = min(gaps,minStep)\n\t}\n\treturn minStep\n\n}\n\nfunc maxStep(stones []int) int {\n\ttotal := stones[len(stones) - 1] - stones[0] + 1\n\tspace := total - len(stones)\n\treturn max(space -( stones[1] - stones[0] - 1),space - ( stones[len(stones) - 1] - stones[len(stones) - 2] - 1))\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n```
[]