From e96f5bd14b2ecdcfb151be407845c5e58d79104d Mon Sep 17 00:00:00 2001 From: Muhammed Mustafa Date: Tue, 31 May 2022 14:52:55 +0200 Subject: [PATCH] fix(curriculum): external monkey and coconuts links in CIP (#46245) * fix(curriculum): external monkeyAndCoconuts links in CIP * clearer description * Clearer Clearer description * grammer typo and better description Co-authored-by: Sem Bauke <46919888+Sembauke@users.noreply.github.com> Co-authored-by: Sem Bauke <46919888+Sembauke@users.noreply.github.com> --- .../sailors-coconuts-and-a-monkey-problem.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/curriculum/challenges/english/10-coding-interview-prep/rosetta-code/sailors-coconuts-and-a-monkey-problem.md b/curriculum/challenges/english/10-coding-interview-prep/rosetta-code/sailors-coconuts-and-a-monkey-problem.md index ec8a0c6e2db..b0f1c7a22d9 100644 --- a/curriculum/challenges/english/10-coding-interview-prep/rosetta-code/sailors-coconuts-and-a-monkey-problem.md +++ b/curriculum/challenges/english/10-coding-interview-prep/rosetta-code/sailors-coconuts-and-a-monkey-problem.md @@ -8,16 +8,17 @@ dashedName: sailors-coconuts-and-a-monkey-problem # --description-- -Five sailors are shipwrecked on an island and collect a large pile of coconuts during the day. That night the first sailor wakes up and decides to take his first share early so tries to divide the pile of coconuts equally into five piles but finds that there is one coconut left over, so he tosses it to a monkey and then hides "his" one of the five equally sized piles of coconuts and pushes the other four piles together to form a single visible pile of coconuts again and goes to bed. To cut a long story short, each of the sailors in turn gets up once during the night and performs the same actions of dividing the coconut pile into five, finding that one coconut is left over and giving that single remainder coconut to the monkey. In the morning (after the surreptitious and separate action of each of the five sailors during the night), the remaining coconuts are divided into five equal piles for each of the sailors, whereupon it is found that the pile of coconuts divides equally amongst the sailors with no remainder. (Nothing for the monkey in the morning.) +Five sailors are shipwrecked on an island and collect a large pile of coconuts during the day. + +That night the first sailor wakes up and decides to take his first share early so tries to divide the pile of coconuts equally into five piles but finds that there is one coconut left over, so he tosses it to a monkey and then hides "his" one of the five equally sized piles of coconuts and pushes the other four piles together to form a single visible pile of coconuts again and goes to bed. + +To cut a long story short, each of the sailors in turn gets up once during the night and performs the same actions of dividing the coconut pile into five, finding that one coconut is left over and giving that single remainder coconut to the monkey, then push the other four piles together to form a single pile. + +In the morning (after the surreptitious and separate action of each of the five sailors during the night), the remaining coconuts are divided into five equal piles for each of the sailors, whereupon it is found that the pile of coconuts divides equally amongst the sailors with no remainder. (Nothing for the monkey in the morning.) # --instructions-- -Create a function that returns the minimum possible size of the initial pile of coconuts collected during the day for `N` sailors. **Note:** Of course the tale is told in a world where the collection of any amount of coconuts in a day and multiple divisions of the pile, etc. can occur in time fitting the story line, so as not to affect the mathematics. **C.f:** - - +Create a function that returns the minimum possible size of the initial pile of coconuts collected during the day for `N` sailors. **Note:** Of course the tale is told in a world where the collection of any number of coconuts in a day and multiple divisions of the pile, etc. can occur in time fitting the story line, so as not to affect mathematics. # --hints--