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.
No.
As it reads
{1,4,4,4,0,4,3,3,1} becomes:
{1,12,null,null,0,4,6,null,1}
This comment is hidden because it contains spoiler information about the solution
I'm confused how this solution doesn't produce {1,12,8,4,0,4,6,3,1} for Input: {1,4,4,4,0,4,3,3,1} but I couldn't figure out any one liner so what do I know.
I beg to differ, as bad practice is to modify input in place if not required, not to just pass objects which are mutable.
Pretty anything immutable. Tuple is great.
Its definitely not a problem for kata itself, rather developing bad practice for greenhorns. IMO, for sure.
That could be a suggestion, at best, but I would not call it an issue, otherwise you should flag A LOT of other katas.
And, mh... it is quite debatable: what would you pass in a similar problem?
Passing list as argument to function is kind of antipattern for python in most cases
I would say they do, based on about 6000 people completing it successfully.
Can you be a bit more specific?
[I will also close the issue, assuming it is not about something not actually working in the tests]
I was getting this due to code running longer than the timeout
Test's don't really match expectations based on instructions.
Test Cases Incorrect for Submission - Console.WriteLine'd out on C# Test
The instructions do not specify any race is a ZERO value, and Tests within the ShouldBeATie Section show that the zeros do not count towards score:
Good: 1 0 0 0 0 0
Evil: 1 0 0 0 0 0 0 (From ShouldBeATie)
Cannot make all tests pass by accounting for 0 value or not!
Time: 671ms Passed: 3 Failed: 3
Test Results:
GoodVsEvil
EvilShouldWin
Log
Good: 1 1 1 1 1 1
Evil: 1 1 1 1 1 1 1
Good: 1 1 1 1 1 1 -- Is not EvilShouldWin (Is Infact a Draw)
Evil: 0 1 1 1 1 1 1 -- Is not EvilShouldWin (Is Infact a Draw)
✔ 1 assertion passed
✘ Expected string length 48 but was 45. Strings differ at index 15.
Expected: "Battle Result: Evil eradicates all trace of Good"
But was: "Battle Result: No victor on this battle field"
--------------------------^
Completed in 0.026539ms
GoodShouldTriumph
Log
Good: 0 0 0 0 0 10
Evil: 0 1 1 1 1 0 0
Good: 1 1 1 1 1 1
Evil: 0 0 1 1 1 1 1
Good: 0 1 0 0 0 0 -- Is not GoodShouldTriupmh (Is Infact a Draw)
Evil: 1 0 0 0 0 0 0 -- Is not GoodShouldTriupmh (Is Infact a Draw)
✔ 2 assertions passed
✘ Expected string length 38 but was 45. Strings differ at index 15.
Expected: "Battle Result: Good triumphs over Evil"
But was: "Battle Result: No victor on this battle field"
--------------------------^
Completed in 0.00101ms
ShouldBeATie
Log
Good: 1 0 0 0 0 0
Evil: 1 0 0 0 0 0 0
Good: 0 0 0 0 0 0
Evil: 0 0 0 0 0 0 0
Good: 1 1 1 1 1 1
Evil: 1 0 1 1 1 1 1
Good: 1 0 0 0 0 0
Evil: 1 0 0 0 0 0 0
Good: 0 1 0 0 0 0
Evil: 0 1 0 0 0 0 0
Good: 0 1 0 0 0 0
Evil: 0 0 1 0 0 0 0
Good: 0 1 0 0 0 0
Evil: 0 0 0 1 0 0 0
Good: 0 0 1 0 0 0
Evil: 0 0 0 0 1 0 0
Good: 0 0 0 1 0 0
Evil: 0 0 0 0 1 0 0
Good: 1 0 0 0 1 0 -- Not A Tie (Good Wins)
Evil: 0 0 0 0 0 1 0 -- Not A Tie (Good Wins)
✔ 9 assertions passed
✘ Expected string length 45 but was 38. Strings differ at index 15.
Expected: "Battle Result: No victor on this battle field"
But was: "Battle Result: Good triumphs over Evil"
--------------------------^
Completed in 0.000577ms