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.
super helpful! Thank you cattlebruiser!
This comment is hidden because it contains spoiler information about the solution
Nice solution btw))))
This comment is hidden because it contains spoiler information about the solution
Only the kata author can republish the kata.
Anyway I can help make it a non-draft kata?
This kata is currently a
Draft
. You can attempt the tests, but cannot submit your solution.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
I solved the problem because some of the changes I have on my computer have not been updated to my browser in time. I will look at the link when I have solved the problem.
Could you try pasting your code again using ``` before and after your code in a separate line? See the link I posted above. Otherwise it lose indentation and some other things.I've copied/pasted your code but it gave me an error because something was lost without formatting.
WeightSort.orderWeight("2000 103 123 4444 99");
I compiled it in eclipse and it turned out to be correct.
2000 103 123 4444 99
You're welcome.
Loading more items...