← Home
For problem statement at 0-999/100-199/190-199/192/problemB.txt this is a correct solution, but verifier at 0-999/100-199/190-199/192/verifierB.go ends with All tests passed can you fix the verifier? ```go
package main

import (
	"bufio"
	"fmt"
	"os"
)

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()

	var n int
	if _, err := fmt.Fscan(in, &n); err != nil {
		return
	}
	a := make([]int, n)
	for i := 0; i < n; i++ {
		fmt.Fscan(in, &a[i])
	}

	t := a[0]
	if a[n-1] < t {
		t = a[n-1]
	}
	for i := 0; i+1 < n; i++ {
		m := a[i]
		if a[i+1] > m {
			m = a[i+1]
		}
		if m < t {
			t = m
		}
	}
	fmt.Fprintln(out, t)
}
```