func reverse(x int) int {
s := strconv.Itoa(x)
b := strings.Builder{}
var index = 0
if s[0] == '-' {
b.WriteByte('-')
index = 1
}
for i := len(s) - 1; i >= index; i-- {
b.WriteByte(s[i])
}
n, _ := strconv.Atoi(b.String())
if n > 2<<30-1 || n < -2<<30 {
return 0
}
return n
}