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
?