Skip to content

Commit f6214fc

Browse files
authored
Fix Knapsack hints.md headings (#1646)
* List all hints under a "General" heading * Use underscore for italics, to match the style in most other exercise docs
1 parent 7e8509d commit f6214fc

File tree

1 file changed

+6
-14
lines changed
  • exercises/practice/knapsack/.docs

1 file changed

+6
-14
lines changed

exercises/practice/knapsack/.docs/hints.md

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,14 @@
11
# Hints
22

3-
## A starting point: brute-force recursion
3+
## General
44

5-
If you're stuck, a good starting point is a brute-force recursive solution.
5+
- A good starting point is a brute-force recursive solution.
66
You can see it sketched out in the first half of the article ["Demystifying the 0-1 knapsack problem: top solutions explained"](demystifying-the-knapsack-problem).
7-
8-
## Dynamic programming: what is it?
9-
10-
For a more efficient solution, you can improve your recursive solution using *dynamic programming*, which is introduced in the second half of [the above-mentioned article](demystifying-the-knapsack-problem).
11-
7+
- For a more efficient solution, you can improve your recursive solution using _dynamic programming_, which is introduced in the second half of [the above-mentioned article](demystifying-the-knapsack-problem).
128
For a more general explainer, see the video ["5 Simple Steps for Solving Dynamic Programming Problems"](solving-dynamic-programming-problems)
13-
14-
## Dynamic programming and the knapsack problem
15-
16-
If you need a more visual walkthrough of how to apply dynamic programming to the knapsack problem, see the video ["0/1 Knapsack problem | Dynamic Programming"](0-1-knapsack-problem).
17-
18-
Also worth mentioning is [this answer](intuition-of-dp-for-knapsack-problem) to a question on Reddit, *"What is the intuition behind Knapsack problem solution using dynamic programming?"*.
19-
Here is the answer in full:
9+
- If you need a more visual walkthrough of how to apply dynamic programming to the knapsack problem, see the video ["0/1 Knapsack problem | Dynamic Programming"](0-1-knapsack-problem).
10+
Also worth mentioning is [this answer](intuition-of-dp-for-knapsack-problem) to a question on Reddit, _"What is the intuition behind Knapsack problem solution using dynamic programming?"_.
11+
Below is the answer in full.
2012

2113
> The intuition behind the solution is basically like any dynamic programming solution: split the task into many sub-tasks, and save solutions to these sub-tasks for later use.
2214
>

0 commit comments

Comments
 (0)