Golang solution with explanation, not good enough
go\nfunc numMovesStonesII(stones []int) []int {\n\tsort.Ints(stones)\n\t// calc all gaps\n\tgap := make([]int, 0)\n\tfor i := 1; i < len(stones); i++ {\n\t\tdif
```go\nfunc numMovesStonesII(stones []int) []int {\n\tsort.Ints(stones)\n\t// calc all gaps\n\tgap := make([]int, 0)\n\tfor i := 1; i < len(stones); i++ {\n\t\tdiff := stones[i] - stones[i-1]\n\t\tif diff > 1 {\n\t\t\tgap = append(gap, diff-1)\n\t\t}\n\t}\n\t// calc max here\n\t// each move, we will lost one gap\n\t// we may lose more than one gap at the first move\n\tmax := 0\n\tfor _, v := range gap {\n\t\tmax += v\n\t}\n\tgapBoundL := stones[1] - stones[0] - 1\n\tgapBoundR := stones[len(stones)-1] - stones[len(stones)-2] - 1\n\tif gapBoundL < gapBoundR {\n\t\tmax -= gapBoundL\n\t} else {\n\t\tmax -= gapBoundR\n\t}\n\t// calc min here\n    // we need move stones until they are all continuously\n\tcount := 1\n\tfor l, r := 0, 1; r < len(stones); {\n\t\tif stones[r] - stones[l] < len(stones) {\n\t\t\tif current := r - l + 1; current > count {\n\t\t\t\tcount = current\n\t\t\t}\n\t\t\tr++\n\t\t} else {\n\t\t\tl++\n\t\t}\n\t}\n\tmin := len(stones) - count\n    if min == 1 && len(gap) == 1 && gap[0] != 1 {\n        // [6,5,4,3,10], cap = [3]\n        // we need 2-moves\n        // [4,5,6,8,10]\n        // [4,5,6,7,8]\n        \n        // [6,5,4,3,8], cap = [1]\n        // one move is enough\n        \n        // [6,5,10,3,7], cap = [1,2]\n        // one move is enough\n        min++\n    }\n\treturn []int{min, max}\n}\n```
['Go']