iT邦幫忙

2025 iThome 鐵人賽

DAY 5
0
自我挑戰組

leetcode系列 第 5

leetcode 5. Longest Palindromic Substring

  • 分享至 

  • xImage
  •  

題目:
Given a string s, return the longest palindromic substring in s.
給定一個字串 s,請找出 最長的不含重複字元的子字串長度

https://ithelp.ithome.com.tw/upload/images/20250919/20169340YfexX9ULSL.png

問題重點

給定字串 s,找出其中 最長的迴文子字串,並回傳該子字串

迴文的定義:字串正著讀、反著讀都一樣
例如:aba、abba、racecar

解題思路:
https://ithelp.ithome.com.tw/upload/images/20250919/20169340SpP5Ef0ozd.png


上一篇
leetcode 4. Median of Two Sorted Arrays
下一篇
leetcode 6. Zigzag Conversion
系列文
leetcode8
圖片
  熱門推薦
圖片
{{ item.channelVendor }} | {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言