Issue with "Bonfire: Pairwise". Test wrong?
See original GitHub issueI was going to do this bonfire, and, after a time thinking about how to do it, I noticed this test:
expect(pairwise([0, 0, 0, 0, 1, 1], 1)).to.equal(10);
expected 1 to equal 10
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:
Bla bla bla If multiple sums are possible, return the smallest sum. Once an element has been used, it cannot be reused to pair with another.
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.
Issue Analytics
- State:
- Created 8 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Bonferroni correction - Wikipedia
In statistics, the Bonferroni correction is a method to counteract the multiple comparisons problem. ... Of note, the Bonferroni correction controls for family-wise...
Read more >Previous render sometimes leaking into next test #716 - GitHub
I'm running into the same issue that the previous render leaks into the next test. Sounds to me like a very bad thing...
Read more >Types of Errors in Hypothesis Testing - Statistics By Jim
Learn about the two types of errors in statistical hypothesis testing, their causes, and how to manage them.
Read more >Do This When Your Fire Stick Remote Is Not Working - YouTube
https://www.smartdnsproxy.com - Get 14 Days free trial. - Smart DNS Proxy, VPN & SmartVPN services. 400+ Global streaming network access.
Read more >10 common issues with Amazon Fire TV stick and how to fix ...
To help you use the streaming device smoothly, here are 10 common issues with Fire TV devices and how you can resolve them....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@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:
So the test is required to ensure that the solution has correctly picked the lowest sum.
I don’t understand. The problem clearly says
If multiple pairs are possible that have the same numeric elements but different indexes, return the smallest sum of indexes.
So for test case:
[0, 0, 0, 0, 1, 1] Indexes: [0,4], [1,5] Values: [0,1],[0,1]
The indexes 1+5 should be not included, hence the answer should be 0+4 = 4, right?