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.
It reads, "remove those two digits from the string", but then the spaces are both assumed and relevant, part of the string which never really got "smaller" (shorter). If it means "replace those two digits with spaces", and "return the minimum possible number of remaining ones and zeroes" then it should say that. Also that apparently was a question in the past, but now it's a direct instruction, and it still has a question mark.
past or present denominators, or defaults
That line, paraphrased / decoded / whatever:
(l+r)/(m+s)
is each new fraction (next iteration), before substitution and simplification. Letl/m
represent whatever the fraction was, just before you most recently parsed anL
choice. Letr/s
represent whatever the fraction was, just before you most recently parsed anR
choice.This is how values of
l, r, m, s
are obtained most often. Butl = 1, r = 0, m = 0, s = 1
are defaults, used when there is no previously parsed L or R (or neither, as shown in the way that the initial1/1
, corresponding to the empty string, is formed entirely out of them).HTH
wat.
It seems to be. Thanks!
Rust translation
should be fixed, can you check ?
The sample test
shows that if the second index is past the end of the string, you simply reverse from the first index to the end of the string.
"The first index a will always be lower that than the string length;
the second index b can be greater than the string length.
More examples in the test cases. Good luck!"
the second index b cannot be greater than the string length else it will be out of range.
can someone explain me the instruction?
In C, random tests seem to be pulling in & also reversing the null terminator, thus truncating the "expected" string.
edit++: When printing input and results, it appears that I will pass several or even some dozens of random tests before failing this way. Of course I tried re-submitting, but this happens every time, eventually.
so I didn't need to store the whole sequence up to
n
, and that was a mistake, but if you ever need that, here it isResolved with fork above approved
facepalm
So there is no particular order to restore. Thanks.
i can confirm that the random tests in C produce garbage due to a faulty pointer dereference. however, you can still pass the tests as you do not need to print or strcmp the array elements, but merely swap them
C fork
Random tests in C give me really random things such as
"%@" H%@ =%@
. I thought, maybe I'm supposed to sort / alphabetize this, since top-middle-bottom and sky-rainbow-ground are in descending alphabetical order-- but then head-body-tail isn't in any order. And then I got%@ %@ %@
which includes non-printable bytes in front of the 2nd and 3rd%
s which show as a red dot in this editor but not on the page afterward.So it must be the 0x1a and 0x08. I couldn't run hexdump and middle-click in that terminal because (apparently) it caught 0x1A as Ctrl+Z and dutifully stopped.
Loading more items...