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.
This comment is hidden because it contains spoiler information about the solution
Anyway I can help make it a non-draft kata?
I've never done a Beta question before. After I "attempt", it says all tests passed, submit when ready, but the Submit Final never shows up. How do I proceed?
Can you explain the
score[+(att[i] > def[i])]++;
line?++ increments the value in score.
If
att[i] > def[i]
is true (attacker rolls higher than defender, so defender score should increase): this evaluates to 1, the+()
insidescore[]
increases the index to 1, so the defender score is the one that gets incremented?If attacker roll is lower or equal than defender, then
att[i] > def[i]
will evaluate tofalse
or0
, and the 0th index (attacker score) gets incremented?If this is not correct, can you explain
score[+(att[i] > def[i])]++;
?This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Am I interpretting the instructions correctly: sort numbers by weight. If two numbers have same weight, sort them as strings?
The example in the instructions show
"56 65 74 100 99 68 86 180 90" ordered by numbers weights becomes: "100 180 90 56 65 74 68 86 99"
But wouldn't
56 65 74 100 99 68 86 180 90
weights be2 2 2 1 9 5 5 9 9
(the weights of 99, 180, and 90 are 9). How come in the example given,180
and90
are listed betweeen values that have weights 1 and 2?Shouldn't the correct sort be
100 56 65 74 68 86 180 90 99
(so the weights are1 2 2 2 5 5 9 9 9
)?Sometimes, I accidentally swipe "back" on the browser. Oftentimes, when click "Train Again", my code isn't saved from before (even though I click "Run Sample Tests" often to try to "save" my code). Can you implement the option to have a warning alert "Do you want to leave the page?"
The first time I submitted my code, I received "Unhandled rejection TestError: Expected: ..."
The second time I submitted my code, it passed. Do you want to look at the error and/or my code?
Can I have a hint (JavaScript) on how to add the space before the state name? Adding ' ' or ' ' doesn't help.
The JavaScript version's instructions for nose is missing
~
. Currently, it says-A smiley face can have a nose but it does not have to. Valid characters for a nose are
-
orThis comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
In Javascript "Run Sample Tests", only the first test runs.
Loading more items...