← Home
For problem statement at 0-999/800-899/860-869/864/problemB.txt this is a correct solution, but verifier at 0-999/800-899/860-869/864/verifierB.go ends with All tests passed can you fix the verifier? package main

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

func main() {
	in := bufio.NewReader(os.Stdin)
	var n int
	var s string
	fmt.Fscan(in, &n, &s)

	ans, cnt := 0, 0
	mask := 0

	for i := 0; i < len(s); i++ {
		c := s[i]
		if c >= 'A' && c <= 'Z' {
			if cnt > ans {
				ans = cnt
			}
			mask = 0
			cnt = 0
		} else {
			bit := 1 << (c - 'a')
			if mask&bit == 0 {
				mask |= bit
				cnt++
			}
		}
	}

	if cnt > ans {
		ans = cnt
	}

	fmt.Println(ans)
}