I am a new learner with Go, and these problems confused me a lot. I cannot solve them, could you guys give me a hand?
func Solution(A []int, B[]int, K int) int{
.......
res = MaxInt32
low = 0
high = Min(900, largestId) //largestId is limited here
mid = 0
while(low <= high){
mid = {low + high} / 2 55
if(isAvailable(K, mid)){
res := Min(res, mid)
high :=mid - 1
} else{
low := mid + 1
}
}
return res 64
} 65
The errors show:
workspace/src/solution/solution.go:55: syntax error: unexpected =, expecting }
workspace/src/solution/solution.go:64: non-declaration statement outside function body
workspace/src/solution/solution.go:65: syntax error: unexpected }
I don't understand why these problems come?