Piet Souris wrote:if monkey 0 processes value 200, and should send it to monkey 1, that has a dividableBy 13, then you do not need to send that 200, but 200 % 13 = 5
Tim Cooke wrote:...idea does work for the very next monkey but not for other monkeys after that. Might there be something else you can do to the worry level that will work for all monkey tests?
Mike Simmons wrote:Tim C's hints are exactly on target for this one.
Tim Driven Development | Test until the fear goes away
Tim Driven Development | Test until the fear goes away
Mike Simmons wrote:But why? It's still a fun, worthwhile exercise - hints or no.
There are three kinds of actuaries: those who can count, and those who can't.
There are three kinds of actuaries: those who can count, and those who can't.
There are three kinds of actuaries: those who can count, and those who can't.
There are three kinds of actuaries: those who can count, and those who can't.
Tim Driven Development | Test until the fear goes away
There are three kinds of actuaries: those who can count, and those who can't.
If exactly one value is an integer, convert the integer to a list which contains that integer as its only value, then retry the comparison. For example, if comparing [0,0,0] and 2, convert the right value to [2] (a list containing 2); the result is then found by instead comparing [0,0,0] and [2].
If both values are lists, compare the first value of each list, then the second value, and so on. If the left list runs out of items first, the inputs are in the right order. If the right list runs out of items first, the inputs are not in the right order. If the lists are the same length and no comparison makes a decision about the order, continue checking the next part of the input.
== Pair 2 ==
- Compare [[1],[2,3,4]] vs [[1],4]
- Compare [1] vs [1]
- Compare 1 vs 1
- Compare [2,3,4] vs 4
- Mixed types; convert right to [4] and retry comparison
- Compare [2,3,4] vs [4]
- Compare 2 vs 4
- Left side is smaller, so inputs are in the right order
Tim Driven Development | Test until the fear goes away
There are three kinds of actuaries: those who can count, and those who can't.
Tim Driven Development | Test until the fear goes away
There are three kinds of actuaries: those who can count, and those who can't.
Tim Driven Development | Test until the fear goes away
Tim Cooke wrote:...and I hope..
There are three kinds of actuaries: those who can count, and those who can't.
Tim Driven Development | Test until the fear goes away
Tim Driven Development | Test until the fear goes away
Tim Driven Development | Test until the fear goes away
There are three kinds of actuaries: those who can count, and those who can't.
Stephan van Hulst wrote:If you need help with part 2, the hint I gave earlier in this topic turned out to work well for me, and it even outperformed the solution I had for part 1.
Time is the best teacher, but unfortunately, it kills all of its students - Robin Williams. tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|