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 for pointing me in the right direction
read discuss in bottom
|
v
This comment is hidden because it contains spoiler information about the solution
I fixed the bug in random test like this:
const _random = Math.random; Math.random = () => _random() + 1;
Tests for JS is very bad: https://www.codewars.com/kata/reviews/54df3072a1b757b06d000050/groups/5be80c1945394b25c10012ab
This comment is hidden because it contains spoiler information about the solution
Difficult but possible: https://www.codewars.com/kata/reviews/58e03f832c99b9c419000631/groups/5bba236eb684d379b1000004
Check your random tests. The error is there.
Bug in tests?
matrix = [
[ 100, 25, 59, 35, 22, 11, 42, 75, 99, 7 ],
[ 35, 61, 76, 74, 72, 45, 31, 7, 70, 82 ],
[ 46, 37, 30, 55, 14, 51, 18, 44, 6, 35 ],
[ 41, 2, 34, 34, 43, 56, 13, 71, 44, 17 ],
[ 1, 8, 61, 35, 19, 16, 66, 25, 4, 39 ],
[ 9, 71, 49, 11, 49, 53, 50, 81, 86, 62 ],
[ 97, 19, 87, 16, 15, 37, 95, 38, 37, 21 ],
[ 2, 55, 49, 96, 88, 21, 79, 76, 60, 54 ],
[ 75, 86, 98, 92, 91, 73, 75, 77, 100, 20 ],
[ 96, 82, 49, 5, 49, 81, 60, 60, 51, 40 ]
];
get_neighbourhood("von_neumann", matrix, [ 5, 8 ], 1);
Expected: '[4]', instead got: '[37, 4, 62, 81]'
Why 4?