aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMohammad S Anwar <Mohammad.Anwar@yahoo.com>2022-02-11 16:49:24 +0000
committerGitHub <noreply@github.com>2022-02-11 16:49:24 +0000
commita11e2ef5af2dc895927d7e56a2698738892e0166 (patch)
treec3ef85d8a757be4c24f3ffbb96b3b88935320f7d
parent4414465b228337dadfed28d466a1fe7b2b907371 (diff)
parent7a06a5f729b4f71c1cd60e246ed15d5faaabe9b5 (diff)
downloadperlweeklychallenge-club-a11e2ef5af2dc895927d7e56a2698738892e0166.tar.gz
perlweeklychallenge-club-a11e2ef5af2dc895927d7e56a2698738892e0166.tar.bz2
perlweeklychallenge-club-a11e2ef5af2dc895927d7e56a2698738892e0166.zip
Merge pull request #5638 from drbaggy/master
Update README.md
-rw-r--r--challenge-151/james-smith/README.md13
1 files changed, 13 insertions, 0 deletions
diff --git a/challenge-151/james-smith/README.md b/challenge-151/james-smith/README.md
index 7f3a84e2f4..b6806a1ee6 100644
--- a/challenge-151/james-smith/README.md
+++ b/challenge-151/james-smith/README.md
@@ -49,6 +49,19 @@ sub depth {
We can walk along the house and work out what the best score we could get if we stopped the journey at any house. As we add in each extra house - best score depends on the best score of one of the last two houses visited and the points of the current house.
+We will only ever skip one or two houses at each "jump", we will never skip more than two. There is always a better option which is to select one of the nodes in the middle. So the jump from 1 to 5 (skipping three) will always score less than the jump from 1 to 3 and 3 to 5. This is because you will miss plundering house No 3....
+
+```
+ ====== ====== ====== ====== ====== ======
+ ======== ======== ======== ======== ======== ========
+ | No 1 | | No 2 | | No 3 | | No 4 | | No 5 | | No 6 |
+ -------- -------- -------- -------- -------- --------
+ | | | | | |
+ | `--->------>---' `--->------>---' |
+ | |
+ `--->------>------>------>------>------>---'
+```
+
Here we construct and array of the best total we could achieve if we stopped at the 1st, 2nd, 3rd houses etc...
For the first two: