← Home
For problem statement at 1000-1999/1700-1799/1770-1779/1774/problemC.txt this is a correct solution, but verifier at 1000-1999/1700-1799/1770-1779/1774/verifierC.go ends with All 61 tests passed. can you fix the verifier? ```go
package main

import (
	"bufio"
	"bytes"
	"io"
	"os"
	"strconv"
)

func main() {
	data, _ := io.ReadAll(os.Stdin)
	idx := 0

	nextInt := func() int {
		for idx < len(data) && (data[idx] == ' ' || data[idx] == '\n' || data[idx] == '\r' || data[idx] == '\t') {
			idx++
		}
		val := 0
		for idx < len(data) && data[idx] >= '0' && data[idx] <= '9' {
			val = val*10 + int(data[idx]-'0')
			idx++
		}
		return val
	}

	nextString := func() string {
		for idx < len(data) && (data[idx] == ' ' || data[idx] == '\n' || data[idx] == '\r' || data[idx] == '\t') {
			idx++
		}
		start := idx
		for idx < len(data) && data[idx] != ' ' && data[idx] != '\n' && data[idx] != '\r' && data[idx] != '\t' {
			idx++
		}
		return string(data[start:idx])
	}

	t := nextInt()
	var out bytes.Buffer

	for tc := 0; tc < t; tc++ {
		n := nextInt()
		s := nextString()

		last0, last1 := 0, 0
		for i := 1; i <= n-1; i++ {
			if i > 1 {
				out.WriteByte(' ')
			}
			if s[i-1] == '0' {
				last0 = i
				out.WriteString(strconv.Itoa(last1 + 1))
			} else {
				last1 = i
				out.WriteString(strconv.Itoa(last0 + 1))
			}
		}
		if tc+1 < t {
			out.WriteByte('\n')
		}
	}

	w := bufio.NewWriterSize(os.Stdout, 1<<20)
	w.Write(out.Bytes())
	w.Flush()
}
```