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.
funny but nice ........
Fixed.
Fixed
In the random test data, when passing in a 0 value to the battle method, the test is treating that as a valid opponent level score. The instructions state only levels 1-100 are valid; therefore, the expected return value should be "Invalid level".
Additionally on the battle(0) calls, experience points are also being awarded depending the Warrior's current level.
Incorrect kata.
Since in the description it says "We need a function that receives two arrays arr1 and arr2, each of them, with elements that occur only once".
OCCUR ONLY ONCE!
But in the random tests there are a lot of repetitions. So be careful - you have to filter array first to leave just unique valu@es.
@raulbc777, you should change either description or tests.
Definitely something wring with the random tests (I failed 20 of them after passing all of the basic tests):
Small Arrays
arr1: [34, 38, 7, 6, 4, 46, 17, 36, 33, 45, 1, 47, 13, 14, 11, 32, 20, 9, 49, 18, 21, 35, 19, 40]
arr2: [33, 2, 30, 46, 15, 5, 20, 11, 0, 24, 50, 6, 37, 16, 13, 29, 44, 32, 21, 1, 12, 35]
✘ Expected: [0, 26, 14, 12], instead got: [10, 26, 14, 12]
The intersection of the two arrays is [6, 46, 33, 1, 13, 11, 32, 20, 21, 35] for a length of 10.
Confirmed with minitest on my local machine:
def test_random_example
arr1 = [34, 38, 7, 6, 4, 46, 17, 36, 33, 45, 1, 47, 13, 14, 11, 32, 20, 9, 49, 18, 21, 35, 19, 40]
arr2 = [33, 2, 30, 46, 15, 5, 20, 11, 0, 24, 50, 6, 37, 16, 13, 29, 44, 32, 21, 1, 12, 35]
assert_equal(process_2arrays(arr1, arr2), [10, 26, 14, 12])
end
Running:
.
Finished in 0.001227s, 814.9959 runs/s, 814.9959 assertions/s.
1 runs, 1 assertions, 0 failures, 0 errors, 0 skips