iT邦幫忙

2025 iThome 鐵人賽

DAY 12
0

題目介紹:

  • 編號:20
  • 類型:String, Stack
  • 難度:easy
  • 題目連結:https://leetcode.com/problems/valid-parentheses/
  • 描述:給定一個只包含 () [] {} 的字串,請判斷是否為有效的括號配對。

有效的條件如下:

  • 括號必須「成對」出現。
  • 開始順序要正確:先開後關。
  • 不能有交錯或不成對的符號。

解題成功截圖:
https://ithelp.ithome.com.tw/upload/images/20250926/201788404Otwx6zkjA.jpg

notion筆記截圖:
https://ithelp.ithome.com.tw/upload/images/20250926/201788402u1egYR366.jpghttps://ithelp.ithome.com.tw/upload/images/20250926/20178840hT7feuT55x.jpg


上一篇
<DA11> - Ransom Note
下一篇
<DAY13> - Implement Queue using Stacks
系列文
「用 LeetCode 挑戰 30 天,打造扎實的程式邏輯力」- 結合Notion記錄學習筆記13
圖片
  熱門推薦
圖片
{{ item.channelVendor }} | {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言