I tried a few solutions and had no problem. Moreover 217 guys passed the Rust kata so I am sure there are no errors in the tests.
Did you correctly read the description?
assertion failed: (left == right)
left: "bkkkiiigaaqqiifffaaadwwhaaizzziifpppkuuufffllllrrrskkkltmfpmmlllffftfffdnnn",
right: "llloosssulxbkkkiiigaaqqiifffaaadwwhaaizzziifpppkuuufffllllrrrskkkltmfpmmlll"
i pass basic tests,but failed in extra tests, and it throw it.
i think it do't matter the correctness.
I'm new to programming, so apologies in advance if this sounds dumb. I can't see how this case ('1110000000111') can be interpreted as rate 3. My reasoning goes like this:
1)Pause between words – is 7 time units long
2)if a string of zeroes is suspected of being a pause between words - it must be divisible by 7 with our rate in mind
3)if rate is 3, the pause has to be 21 zeros - not our case
4)Pause between characters inside a word – is 3 time units long
5)if a string of zeroes is suspected of being a pause between characters - it must be divisible by 3 with our rate in mind
6)if rate is 3, the pause has to be 9 zeroes - not our case
7)Pause between dots and dashes in a character – is 1 time unit long
8)if a string of zeroes is suspected of being a pause between dots and dashes - it must be equal to our rate
9)if rate is 3, the pause has to be 3 zeroes - not our case
I understand that human imperfection needs to be accounted for, however, I was under the impression that this is the main topic for the next kata in this series, while in this one the rate remains consistent for the duration of the message. If this is not the case - I've failed to find any mention of possible rate deviations in the kata's description. Am I misreading the instructions?
Well, this kata is not about precise numbers and divisibility.
Some lengths may not be exact, and reasonable guessing is necessary, particularly for short message that cointain no word break (7 units) at all.
In this particular case we can't be exactly sure if this is a dash-word-dash (rate 1) or a dot-dot (rate 3) with a bit longer pause.
To make testing easier we make an assumption that if you're not sure, if this is a dot or a dash, assume it's a dot, which leads us to rate 3 in this case.
This way of thinking is important to handle real-life human made transmissions that is dealt with in the third kata of the series.
This particular edge case test was added to make sure the solution algorithm is tuned correctly for this assumption and can handle more complex tests.
This comment is hidden because it contains spoiler information about the solution
Really like this solution!
Nice solution, thanks!
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 tried a few solutions and had no problem. Moreover 217 guys passed the Rust kata so I am sure there are no errors in the tests.
Did you correctly read the description?
assertion failed:
(left == right)
left:
"bkkkiiigaaqqiifffaaadwwhaaizzziifpppkuuufffllllrrrskkkltmfpmmlllffftfffdnnn"
,right:
"llloosssulxbkkkiiigaaqqiifffaaadwwhaaizzziifpppkuuufffllllrrrskkkltmfpmmlll"
i pass basic tests,but failed in extra tests, and it throw it.
i think it do't matter the correctness.
Please check my comment resolving this issue right above your question.
I'm new to programming, so apologies in advance if this sounds dumb. I can't see how this case ('1110000000111') can be interpreted as rate 3. My reasoning goes like this:
1)Pause between words – is 7 time units long
2)if a string of zeroes is suspected of being a pause between words - it must be divisible by 7 with our rate in mind
3)if rate is 3, the pause has to be 21 zeros - not our case
4)Pause between characters inside a word – is 3 time units long
5)if a string of zeroes is suspected of being a pause between characters - it must be divisible by 3 with our rate in mind
6)if rate is 3, the pause has to be 9 zeroes - not our case
7)Pause between dots and dashes in a character – is 1 time unit long
8)if a string of zeroes is suspected of being a pause between dots and dashes - it must be equal to our rate
9)if rate is 3, the pause has to be 3 zeroes - not our case
I understand that human imperfection needs to be accounted for, however, I was under the impression that this is the main topic for the next kata in this series, while in this one the rate remains consistent for the duration of the message. If this is not the case - I've failed to find any mention of possible rate deviations in the kata's description. Am I misreading the instructions?
Well, this kata is not about precise numbers and divisibility.
Some lengths may not be exact, and reasonable guessing is necessary, particularly for short message that cointain no word break (7 units) at all.
In this particular case we can't be exactly sure if this is a dash-word-dash (rate 1) or a dot-dot (rate 3) with a bit longer pause.
To make testing easier we make an assumption that if you're not sure, if this is a dot or a dash, assume it's a dot, which leads us to rate 3 in this case.
This way of thinking is important to handle real-life human made transmissions that is dealt with in the third kata of the series.
This particular edge case test was added to make sure the solution algorithm is tuned correctly for this assumption and can handle more complex tests.
Why do you think it should it be 1?
when bits = '1110000000111'.
It's time-unit should be 1.
but too many solution's is 3.