Test constraints:
30 sets of random source paints will be tested.
Each source paint will have an R value and a G value ranging from 0 to 1.
Each set of paints will contain up to 10 unique paints. (I create 10, then dedupe.)
Each set of paints will be tested by sampling a 40x40 grid. i.e. the point (0,0) will be tested, then (0,0.25), then (0,0.5) etc, up to (0,0.975), at which point the test will roll over to (0.25,0). Your solution should be able to handle these 48000 validate queries rather quickly - my solution gets them in around 1-2 seconds.
This isn't a bug. You're not passing because you're breaking the tests, you're passing because the operation you're doing in your solution is a valid way to recolor all the nodes. It's not one that I like, but it's valid, and trivializes the issue.
Perhaps the problem should force certain nodes to start as certain colors, in order to disable this trick? If so, that should be a separate kata. I'm certainly not coding it up here.
Traceback (most recent call last):
File "/workspace/default/tests.py", line 11, in <module>
test_run(truth, answer, lines, node_count)
TypeError: test_run() takes 3 positional arguments but 4 were given
Toy tests fails with
ValueError: max() arg is an empty sequence
if solution is differently rotated. E.g. "AACGTTCG" for first test.I added those tests now also in final tests. I don't see what makes these tests so special that you would not pass all of those as well.
Was able to submit a solution without passing all of the 3 initial toy tests. Was this intentional?
Good question. I am struggling also with the node check.
Per the description:
This isn't a bug. You're not passing because you're breaking the tests, you're passing because the operation you're doing in your solution is a valid way to recolor all the nodes. It's not one that I like, but it's valid, and trivializes the issue.
Perhaps the problem should force certain nodes to start as certain colors, in order to disable this trick? If so, that should be a separate kata. I'm certainly not coding it up here.
Regeardless, nice solution. Resolving.
Now deepcopying inputs prior to administrating tests, so mutation doesn't affect validation. Ty for callout.
This comment is hidden because it contains spoiler information about the solution
Sample tests are also broken:
The kata needs to specify
len(paints)
, because this is relevant to the runtime complexity of the solutions too.This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Amazing Kata, thanks for a something closely related to the real world problems.
Thank you for your kind compliment. I try.
This is really great @ALowVerus, thanks for leaving all your work and comments - I wish more people did it as it's a useful learning resource!
Loading more items...