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 looks fixed
I prefer to make all rules consistent and remove the special rule for 0.
Should the 'special rule' be removed, and the description/reference solution fixed? Or should the special rule be mentioned in the description properly?
The reference solution cannot solve some cases. For example, the case
[1, 2, 2, 1, 2, 4, 0, 1, 4], w = 3, l = 3
has the following solution:['M', 'H', 'M', 'H', 'M', 'M', 'H', 'H', 'M']
. But the reference solution returns['?', '?', '?', 'H', '?', 'M', 'H', 'H', 'M']
.It is a paradox if a special rule for 0 is assumed. This rule is not explained in the description (but it is hinted there). See my issue above.
The rule for
people[i] = 0
is not explained in the description. The reference solution and all test cases assume the following rule: ifpeople[i] = 0
then the i-th person and all neighbors of the i-th person are innocents (H
). This rule does not follow from the general rule "there are at least 0 monsters adjacent to me".Random tests sometime fail with the following message:
The reference solution in tests should return
'Situation is paradoxical'
.Don't feel bad about it, most programming problems you'll face in the world won't be solvable with a clean standard library import
Is it simply not tested? Or how does your solution handle paradoxes (I don't quite understand how a situation can be a paradox at all.)
This is indeed not a paradox, just tested with my solution and it gives what you found.
I am confused by the 'paradoxical' situation that you mention. I cannot see how the people represented by
1
are not monsters.The input is
[0, 0, 0, 1, 0, 1, 0, 0, 0]
(From description). Which, in a square, looks like:Now, since
at least 0
must always be true, we can infer that all0
s are human:And now, since we know all surrounding people are Human, the
At least 1
s must definitely be lies -> Monsters.Where is the paradox? Am I missing something??
It's been two weeks at this point... I wonder if there is something wrong?
You sure? Test cases use deepcopy to prevent that
users can mutate inputs in python. At first my solution did not work because of that.
nice easy problem
Loading more items...