← Home
For problem statement at 1000-1999/1100-1199/1140-1149/1144/problemB.txt this is a correct solution, but verifier at 1000-1999/1100-1199/1140-1149/1144/verifierB.go ends with All tests passed. can you fix the verifier?  ```go
package main

import (
	"fmt"
	"sort"
)

func main() {
	var n int
	fmt.Scan(&n)
	
	evens := []int{}
	odds := []int{}
	
	for i := 0; i < n; i++ {
		var x int
		fmt.Scan(&x)
		if x % 2 == 0 {
			evens = append(evens, x)
		} else {
			odds = append(odds, x)
		}
	}
	
	sort.Ints(evens)
	sort.Ints(odds)
	
	e, o := len(evens), len(odds)
	res := 0
	
	if e > o + 1 {
		for i := 0; i < e - o - 1; i++ {
			res += evens[i]
		}
	} else if o > e + 1 {
		for i := 0; i < o - e - 1; i++ {
			res += odds[i]
		}
	}
	
	fmt.Println(res)
}
```