Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Thank you! There is definitely something wrong with the Ruby version.
Well I appreciate you trying to help, but I did not find your comment helpful. I have rewritten my solution 3 different ways (one of which does implement the
reduce
orinject
method) and I am still getting the same results. EVERY SINGLE test is saying that my solution returned 0, when in fact it does not. I know this because I ran my solution on another code editor with the exact same arguments given on the real test and my solution does not return 0. I am not sure how to make this anymore clear, so I will copy and paste the info below. You will see that I pass basic tests just fine, then below that it shows that my solution returns 0 everytime.Test Results:
Basic tests
Test Passed: Value == 30
Test Passed: Value == 9
Test Passed: Value == 495
Test Passed: Value == 0
Test Passed: Value == 3025
Test Passed: Value == 3025
Test Passed: Value == 3025
Test Passed: Value == -10
Test Passed: Value == 0
Test Passed: Value == 5
Test Passed: Value == -5
Test Passed: Value == 0
Test Passed: Value == 65650
Test Passed: Value == 66963
Completed in 3ms
Random tests
Testing for [79, 17, 24, 21], 56 and 237
It should work for random inputs too - Expected: -3718170, instead got: 0
Testing for [24, 28, 15, 87, 15, 17, 81, 22, 4, 54, 47, 23, 56, 73, 96, 96, 61, 1, 91, 90, 71, 29, 35, 49, 41, 36, 57, 64, 75, 23, 27, 78, 9, 81, 13, 49, 94, 69, 51, 69, 14, 43, 75, 86, 23, 74, 100, 34, 1, 98, 17, 41, 59, 34, 14, 17, 89, 28, 45, 24, 20, 66, 99, 71], -98 and -62
It should work for random inputs too - Expected: 8884400, instead got: 0
Testing for [46, 46, 11, 89, 36, 25, 13, 25, 97, 92, 61, 21, 72, 84, 26, 45, 41, 19, 11, 23, 26, 93, 15, 50, 53, 1, 96, 82, 1, 88, 96, 16, 54, 42, 11, 7, 66, 58, 71, 3, 53, 37, 44, 80, 20, 78, 16, 21, 3, 57, 97, 97, 42, 32, 86, 48, 49, 47, 62, 49, 39, 47, 51, 68, 55, 29, 12, 31, 90, 55, 91, 77, 13, 79, 45, 74, 36, 99, 31, 5, 72, 95, 18, 16, 68, 33, 46, 78, 3, 66, 67, 15], 83 and 280
It should work for random inputs too - Expected: -157735116, instead got: 0
Testing for [51, 81, 85, 89, 77, 29, 22, 52, 53, 96, 44, 100, 10, 44, 49, 15, 65, 54, 64, 28, 34, 28, 32, 11, 48, 66, 95, 88, 4, 67, 21, 93, 20, 77, 16, 63, 48, 21, 37, 3, 11, 55, 3, 62, 85, 44, 6, 49, 89, 66, 72, 63, 61, 60, 85, 81, 90, 8, 70, 95, 29, 83, 19, 23, 30, 35, 8, 86, 37, 51, 76, 51, 6, 80, 75, 28, 47, 26, 87, 89, 17, 44, 67, 92, 36, 66, 10, 25, 52, 36, 97, 48, 80, 93, 17], -84 and 62
It should work for random inputs too - Expected: 7785195, instead got: 0
Testing for [36, 18, 36, 41, 91, 95, 63, 49, 100, 92, 15, 80, 96, 31, 3, 60, 49, 38, 46, 35, 99], 45 and 172
It should work for random inputs too - Expected: -16036083, instead got: 0
Testing for [97, 56, 58, 66, 68, 94, 41, 80, 15, 23, 14, 84, 55, 55, 78, 86, 5, 83, 23, 28, 44, 2, 39, 33, 13, 76, 54, 77, 24, 20, 66, 30, 6, 6, 52, 9, 86, 28, 73, 55, 63, 58, 88, 69, 5, 52, 15, 49, 5, 75, 96, 61, 17, 63, 86, 30, 62, 7, 89, 43, 68, 52, 47, 39, 73, 2, 98, 70, 97, 82, 35, 6, 13, 14, 83, 49, 58, 36, 46, 46, 84, 76, 14, 83, 63, 90, 18], 86 and 112
It should work for random inputs too - Expected: -10833075, instead got: 0
Testing for [34, 75, 70, 66, 1, 56, 10, 46, 92, 51, 82, 43, 58, 7, 88, 82, 20, 31, 25, 35, 58, 63], 43 and 229
It should work for random inputs too - Expected: -27499880, instead got: 0
This kata does not work correctly for Ruby. My solution works fine for sample test cases then fails on every random test. The biggest sign that it is faulty is that it says every single one of the return values for my soltion on the random test cases is 0... I ran the same code with the same arguments in my own editor and it worked just fine.
I am finding the exact same problem with Ruby. Here is what the log is saying:
Testing for KEh 0dWvbIKg and 7EhpFUsvbIKg
It should work for random inputs too - Expected: "7EhpFUsvbIKg\n", instead got: "KEh 0dWvbIKg\n7Eh 0dWvbIKg\n7Ehp0dWvbIKg\n7EhpFdWvbIKg\n7EhpFUWvbIKg\n7EhpFUsvbIKg\n"
My solution passes all normal tests bu fails ALL of the random tests because the random tests solution is just "#{s2}\n"...
In Ruby, the method name being tested for is
hoop_count
however the preloaded working method name ishoopCount
. Had to manually change the working method name tohoop_count
to avoid error.