-
-
Notifications
You must be signed in to change notification settings - Fork 35.9k
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
Issue with "Bonfire: Pairwise". Test wrong? #3375
Comments
I believe I see what you are saying... where the first and 4th test are expecting the sum of all the indices that can be paired to add to the 2 param. But if the description say to only return the smallest sum then test one |
No, @natac13 , because these aren't repeated pairs. I mean, in the test I said, they get the pairs: |
Fair enough I am just going of the if there are multiple sums then return the smallest sum... so because there are two different sum that equal 7 for the first test I though it should only return the sum of |
@soulchainer I've often thought this exercise and its description caused more confusion than it was worth. I believe the test is ok, though. It only says once an element has been used it can't be re-used... it doesn't say, once an integer has been used. It also asks for the sum of all indices that can be paired. The test provides multiple elements with the same value for the purpose of checking if the provided solution can detect the lowest possible combination. Possible answers include: [0, 0, 0, 0, 1, 1]
Indices: 0 + 4, 1 + 5 = 10
Indices: 1 + 4, 2 + 5 = 12
Indices: 2 + 4, 3 + 5 = 14 So the test is required to ensure that the solution has correctly picked the lowest sum. |
Oh. I see. That makes sense, @richchurcher :). |
Closing this issue as resolved. Feel free to follow up if you still have concerns with this bonfire. Thanks and happy coding! |
I don't understand. So for test case: The indexes 1+5 should be not included, hence the answer should be 0+4 = 4, right? |
I was going to do this bonfire, and, after a time thinking about how to do it, I noticed this test:
That's arr[0] + arr[4] = 0+4 = 4
And arr[1] + arr[5] = 1 + 5 = 6
6 + 4 = 10
These are [0,1] pairs, repeated.
Well, the explanation of this bonfire says this:
So, if you get the same pair, Only use the smallest sum of indexes, right?
This test breaks this condition. With this, I don't know if even I can trust in the exercise description. I don't know if the exercise is wrong, if the description is misleading or if only the test is wrong, but something seems to be wrong.
The text was updated successfully, but these errors were encountered: