-
-
Notifications
You must be signed in to change notification settings - Fork 542
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
pythagorean-triplet: new tests require non-trivial solution #1347
Comments
I notice that https://github.com/exercism/docs/blob/master/you-can-help/improve-exercise-metadata.md#extracting-canonical-test-data has a sentence "Performance tests should not be included in the canonical test data." The above sentence must not be taken as support for or opposition against the statement "There exists a performance test in the current canonical test data" I recommend that the decision for this issue be also applied in a similar way to alphametics for #1024 . |
@omer-g from your testing, was the only problematic test After reviewing #1024, the primary difference between the |
I ran the other tests, without the last |
If the tests remain as they are, perhaps something like this could be added alongside an explanation for how to generate primitive triplets? I think there is a good explanation for that in the previous iterations of the Python version. (feel free to reword/correct as needed)
|
Personally I was thinking it was factorial, as the number of number <-> letter assignments is the number of permutations of letters. But since I'm always looking for ways to improve my solutions, if you let me know of the way to do it linearly then I'd be able to improve my solution greatly |
@petertseng No, you're correct. Yikes, I am getting rusty at algorithmic analysis. |
In which case, I'm not honestly sure where I stand on this issue. |
I recently rewrote the Python version of this exercise based on canonical data 1.0.0.
I wanted to update that the trivial solution for finding triplets in a range by brute force takes a very long time on the latest tests (for example this). Almost all solutions I saw used this method and will not finish in reasonable time (if at all). I think it would be difficult for people to find an efficient solution by themselves. Perhaps a hint should be given?
The previous
example.py
would not handle these tests as well. The newexample.py
solves the tests quickly. It generates triplets in range efficiently by building triplets from multiples of primitive triplets.Overall I think the new tests make the exercise more interesting. However, I think it would be difficult for people to come up with an efficient enough solution to pass them in reasonable time. I would be happy to hear what others think.
(related to #1211 )
The text was updated successfully, but these errors were encountered: