Shuai-Lou / HODL

0 stars 0 forks source link

Jan 7th #4

Open Shuai-Lou opened 1 year ago

Shuai-Lou commented 1 year ago
  1. harp 竖琴;反复讨论,不断抱怨
  2. concur 同意,一致
  3. cuticle 角质层
  4. contour 轮廓
  5. commonality 共性
  6. crystalline 透明的
  7. amniotic 羊膜
  8. marshal 安排;司仪
  9. encapsulate 概括;压缩
  10. zinc 锌元素
  11. estivate 夏眠;过夏天
  12. gull 海鸥;欺骗;容易受骗的人
  13. outcrop 漏出地面的岩层
  14. grasshopper 蝗虫
  15. gusher 喷油井;滔滔不绝的人
  16. adobe 砖
  17. sulfate 硫酸盐
  18. brook 忍耐;忍受
  19. demean 贬低...身份
  20. precipitation 沉淀;降水
Shuai-Lou commented 1 year ago

Longest Palindromic Substring

class Solution: def longestPalindrome(self, s: str) -> str: n = len(s) ans = s[0] if n == 1: return ans for i in range(n-1): for j in range(i+1, n): if s[i] == s[j]: res = s[i:j+1] if res == res[::-1] and len(res) > len(ans): ans = res

    return ans