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.
Your code does not always respect that ordering
This comment is hidden because it contains spoiler information about the solution
Hi. I got this error - "calling toRandomArray() and then try to get a given permutation of values
After 100 attempts, has not obtained the desired permutation. Check the randomness of your solution."
All tests pass except for this one. Could you tell me what is the test case fail?
This comment is hidden because it contains spoiler information about the solution
"Ethan,Sophia,Elijah,Addison,Alexander,Matthew,Abigail,Logan,Mason,Isabella,Chloe,Jacob,William,Grace,Benjamin,Michael,Lily,Aiden,Avery,James,Mia,Noah,Ava",
[ 3, 4, 4, 4, 4, 1, 4, 1, 6, 3, 5, 3, 3, 5, 1, 3, 1, 2, 4, 4, 1, 3, 5 ], 2), "Alexander")
case gives mecorrect result in ide and gives error it test.. JS
let albt = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
let vinNum = st.toLowerCase().split(',').map( (el,i) => (el.split('').
reduce( (acc,cur) => acc + +albt.indexOf(cur) + 1,0) + el.length) * we[i]);
let lst = st.split(',').reduce( (acc,cur,i) => {
return acc.push([cur,vinNum[i]]),acc;
},[]).sort(([a,b],[c,d] ) => d - b ).sort(([a,b], [c,d]) => {
return b === d && a.length === c.length ? -1 : 0;
});
return lst[n-1][0];
}
console.log(rank("COLIN,AMANDBA,AMANDAB,CAROL,PauL,JOSEPH",
[1, 4, 4, 5, 2, 1], 4), "PauL");
console.log(rank("William,Willaim,Olivia,Olivai,Lily,Lyli",
[ 1, 1, 1, 1, 1, 1 ], 1), "Willaim");
console.log(rank("Elijah,Chloe,Elizabeth,Matthew,Natalie,Jayden",
[ 1, 3, 5, 5, 3, 6 ], 2), "Matthew");
console.log(rank("Ethan,Sophia,Elijah,Addison,Alexander,Matthew,Abigail,Logan,Mason,Isabella,Chloe,Jacob,William,Grace,Benjamin,Michael,Lily,Aiden,Avery,James,Mia,Noah,Ava",
[ 3, 4, 4, 4, 4, 1, 4, 1, 6, 3, 5, 3, 3, 5, 1, 3, 1, 2, 4, 4, 1, 3, 5 ], 2), "Alexander");
Hmmm. This appears to be a quirk of of the
assert.closeTo
from the test frameworkhttps://www.chaijs.com/api/assert/#method_closeto
You can see for yourself by hardwiring different values near the expected boundary.
So your solution needs to be a tiny bit closer to pass.
js
Which language?
With blob 10 and 'thick' crust ma famous pizza radius is 5.773
expected 5.774 to be close to 5.773 +/- 0.001
test fail, but should pass.