← Home
For problem statement at 0-999/800-899/840-849/847/problemM.txt this is a correct solution, but verifier at 0-999/800-899/840-849/847/verifierM.go ends with tests passed can you fix the verifier? ```go
package main

import (
	"fmt"
)

func main() {
	var n int
	fmt.Scan(&n)
	
	temps := make([]int, n)
	for i := 0; i < n; i++ {
		fmt.Scan(&temps[i])
	}
	
	d := temps[1] - temps[0]
	isAP := true
	for i := 2; i < n; i++ {
		if temps[i] - temps[i-1] != d {
			isAP = false
			break
		}
	}
	
	if isAP {
		fmt.Println(temps[n-1] + d)
	} else {
		fmt.Println(temps[n-1])
	}
}
```