iT邦幫忙

2025 iThome 鐵人賽

DAY 27
0

題目介紹:

  • 編號:198
  • 類型:Array,Dynamic Programming
  • 難度:medium
  • 題目連結:https://leetcode.com/problems/house-robber/description/
  • 描述:你是一名竊賊,計畫沿著街道搶劫住家。每棟房子都藏有一定數量的錢,但唯一的限制是:
    你不能搶連續的兩棟房子,否則會觸發警報。
    給定一個非負整數陣列nums ,代表每棟房子的金額,請計算在不觸發警報的情況下,最多能搶到多少錢。

解題成功截圖:
https://ithelp.ithome.com.tw/upload/images/20251011/201788401pP2DLkfHA.jpg

notion筆記截圖
https://ithelp.ithome.com.tw/upload/images/20251011/201788409LBI514q99.jpghttps://ithelp.ithome.com.tw/upload/images/20251011/20178840cdoYMKzUaJ.jpg


上一篇
<DAY26> -Climbing Stairs
下一篇
<DAY28> - Majority Element
系列文
「用 LeetCode 挑戰 30 天,打造扎實的程式邏輯力」- 結合Notion記錄學習筆記28
圖片
  熱門推薦
圖片
{{ item.channelVendor }} | {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言