Shuai-Lou / HODL

0 stars 0 forks source link

Jan 6th #3

Open Shuai-Lou opened 1 year ago

Shuai-Lou commented 1 year ago
  1. gaseous 气态的;气体的
  2. nectar 花蜜
  3. brackish 含盐的;难吃的
  4. pheromone 费洛蒙
  5. chloride 氯化学元素
  6. bombard 轰炸;炮击
  7. equilibrium 化学平衡;平静
  8. beau 花花公子
  9. cobalt 钴 metal
  10. forager 掠食者
  11. brusquely 唐突的;率直的
  12. goof 犯错误的;蠢人;闲逛
  13. gripe 抱怨;发牢骚
  14. fissure 裂缝
  15. confer 授予;协商
  16. mortality 死亡率
  17. crevice 裂缝
  18. crevasse 大裂缝
  19. fossilize 使成化石
  20. query 询问;疑问
Shuai-Lou commented 1 year ago

Longest Substring Without Repeating Characters

class Solution: def lengthOfLongestSubstring(self, s: str) -> int: if not s: return 0 nb = [] max_len = 0 for i in s: while i in nb: del nb[0] nb.append(i) if len(nb) > max_len: max_len = len(nb) return max_len