Skip to content

Commit da0a377

Browse files
committed
Create README - LeetHub
1 parent d167d0f commit da0a377

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

0198-house-robber/README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<h2><a href="https://leetcode.com/problems/house-robber">198. House Robber</a></h2><h3>Medium</h3><hr><p>You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacent houses have security systems connected and <b>it will automatically contact the police if two adjacent houses were broken into on the same night</b>.</p>
2+
3+
<p>Given an integer array <code>nums</code> representing the amount of money of each house, return <em>the maximum amount of money you can rob tonight <b>without alerting the police</b></em>.</p>
4+
5+
<p>&nbsp;</p>
6+
<p><strong class="example">Example 1:</strong></p>
7+
8+
<pre>
9+
<strong>Input:</strong> nums = [1,2,3,1]
10+
<strong>Output:</strong> 4
11+
<strong>Explanation:</strong> Rob house 1 (money = 1) and then rob house 3 (money = 3).
12+
Total amount you can rob = 1 + 3 = 4.
13+
</pre>
14+
15+
<p><strong class="example">Example 2:</strong></p>
16+
17+
<pre>
18+
<strong>Input:</strong> nums = [2,7,9,3,1]
19+
<strong>Output:</strong> 12
20+
<strong>Explanation:</strong> Rob house 1 (money = 2), rob house 3 (money = 9) and rob house 5 (money = 1).
21+
Total amount you can rob = 2 + 9 + 1 = 12.
22+
</pre>
23+
24+
<p>&nbsp;</p>
25+
<p><strong>Constraints:</strong></p>
26+
27+
<ul>
28+
<li><code>1 &lt;= nums.length &lt;= 100</code></li>
29+
<li><code>0 &lt;= nums[i] &lt;= 400</code></li>
30+
</ul>

0 commit comments

Comments
 (0)