Skip to content

Commit 03b562d

Browse files
author
openset
committed
Update: description
1 parent e4d5884 commit 03b562d

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

problems/last-stone-weight-ii/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,16 @@ we can combine 1 and 1 to get 0 so the array converts to [1] then that's the
4444
<li><code>1 &lt;= stones.length &lt;= 30</code></li>
4545
<li><code>1 &lt;= stones[i] &lt;= 100</code></li>
4646
</ol>
47+
48+
### Related Topics
49+
[[Dynamic Programming](https://github.com/openset/leetcode/tree/master/tag/dynamic-programming/README.md)]
50+
51+
### Hints
52+
<details>
53+
<summary>Hint 1</summary>
54+
Think of the final answer as a sum of weights with + or - sign symbols infront of each weight. Actually, all sums with 1 of each sign symbol are possible.
55+
</details>
56+
<details>
57+
<summary>Hint 2</summary>
58+
Use dynamic programming: for every possible sum with N stones, those sums +x or -x is possible with N+1 stones, where x is the value of the newest stone. (This overcounts sums that are all positive or all negative, but those don't matter.)
59+
</details>

problems/range-sum-query-2d-immutable/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<p>Given a 2D matrix <i>matrix</i>, find the sum of the elements inside the rectangle defined by its upper left corner (<i>row</i>1, <i>col</i>1) and lower right corner (<i>row</i>2, <i>col</i>2).</p>
1515

1616
<p>
17-
<img src="/static/images/courses/range_sum_query_2d.png" border="0" alt="Range Sum Query 2D" /><br />
17+
<img src="https://assets.leetcode-cn.com/aliyun-lc-upload/original_images/range_sum_query_2d.png" border="0" alt="Range Sum Query 2D" /><br />
1818
<small>The above rectangle (with the red border) is defined by (row1, col1) = <b>(2, 1)</b> and (row2, col2) = <b>(4, 3)</b>, which contains sum = <b>8</b>.</small>
1919
</p>
2020

0 commit comments

Comments
 (0)