题目: 题解:
type pair struct {ch bytepos int
}func firstUniqChar(s string) int {n : len(s)pos : [26]int{}for i : range pos[:] {pos[i] n}q : []pair{}for i : range s {ch : s[i] - aif pos[ch] n {pos[ch] iq append(q, pair{ch, i})} e…
题目: 题解:
class Solution:def lengthLongestPath(self, input: str) -> int:ans, i, n 0, 0, len(input)level [0] * (n 1)while i < n:# 检测当前文件的深度depth 1while i < n and input[i] \t:depth 1i 1# 统计当前文件名的长度l…