-
-
Notifications
You must be signed in to change notification settings - Fork 520
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Knapsack hints.md
headings
#1646
Conversation
Hello. Thanks for opening a PR on Exercism 🙂 We ask that all changes to Exercism are discussed on our Community Forum before being opened on GitHub. To enforce this, we automatically close all PRs that are submitted. That doesn't mean your PR is rejected but that we want the initial discussion about it to happen on our forum where a wide range of key contributors across the Exercism ecosystem can weigh in. You can use this link to copy this into a new topic on the forum. If we decide the PR is appropriate, we'll reopen it and continue with it, so please don't delete your local branch. If you're interested in learning more about this auto-responder, please read this blog post. Note: If this PR has been pre-approved, please link back to this PR on the forum thread and a maintainer or staff member will reopen it. |
hints.md
headings
The functionality is coming from exercism/website repository from GetHelpPanel.tsx and It seems to be looking at General in a hardcoded way, not gathering headings. You may want to open a forum discussion on where we would want to go with practice hints. Link to this pull request, but I think it may be more general than just the Ruby track. |
That's a good point, that it might be worthwhile to revisit the way that view works. As a short-term improvement, what do you think about simply listing these hints under a "General" heading, so that all the hints will be displayed? Here's the updated change in my branch: main...fpsvogel:exercism-ruby:fix-knapsack-hint-headings |
I think you are talking about this change: diff --git c/exercises/practice/knapsack/.docs/hints.md w/exercises/practice/knapsack/.docs/hints.md
index 0b1d34ce..0c40f245 100644
--- c/exercises/practice/knapsack/.docs/hints.md
+++ w/exercises/practice/knapsack/.docs/hints.md
@@ -1,22 +1,17 @@
# Hints
-## A starting point: brute-force recursion
+## General
+- **A starting point: brute-force recursion.**
If you're stuck, a good starting point is a brute-force recursive solution.
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).
-
-## Dynamic programming: what is it?
-
+- **Dynamic programming: what is it?**
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).
-
For a more general explainer, see the video ["5 Simple Steps for Solving Dynamic Programming Problems"](solving-dynamic-programming-problems)
-
-## Dynamic programming and the knapsack problem
-
+- **Dynamic programming and the knapsack problem**
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).
-
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?"*.
-Here is the answer in full:
+Below is the answer in full.
> 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.
> I think that would be good. I think we can still use the "bullet point" idea that was being conveyed in the current patch , just not as headers. So I think 🤔 that using the General heading will work. You have already looked at the other exercise (the only other one is Guilded Rose in this track) and it uses only the |
Go ahead and make that change in this PR, and I will reopen this. |
Agreed, it looks better now without the bolded beginning of each list item. |
Please do rebase interactively and form the commits and the message you would like to have presented for this history. For example, one of the commits was to provide numbering, but that is no longer applicable as part of the story of this fix. |
6cdceb2
to
a7d055f
Compare
Done ✅ |
This PR places the hints for Knapsack under a "General" heading.
In the recently-implemented Knapsack exercise, only the last section in
hints.md
is being displayed in the editor UI. See the screenshot below.It seems that a single
General
heading is expected for practice exercises, and if it doesn't exist, the contents under the last heading are used and the previous sections are omitted, as in this case.