func lengthOfLongestSubstring(s string) {
match := make(map[string]int)
var current string
current = s[0]
if match[current] == 1 {
///
}
}
Why do I get the error cannot use s[0] (type byte) as type string in assignment? As far as I can tell it's clear that s is of type string, why does accessing a character turn it into type byte?
s[0]is abyte, not astring. Are you certain that you want to operate only on bytes or should this work with utf8 runes?