Ad
  • Custom User Avatar

    replace it with the amount of times you've already seen it

    First, English uses amount for the sort of quantities for which you would use real (floating point) numbers. For traditionally countable things, or units of continuously variable things, use the word number. (Examples: an amount of water, a number of bottles of water, an amount of rain, a number of centimeters of rain, a number of raindrops, etc.) As an aside, the same distinction applies to how much vs. how many, with many corresponding to a number.

    Second, "the number of times you've already seen it" starts at zero. because "have already" implies the exclusion of this time. OK, you specifically force the first time to get a 1, but the second time it appears, I have already seen it just once, and yet you expect a 2. It's possibly confusing. From the examples, it becomes obvious, but then also it appears that the distinction between the first occurrence and every following occurrence is unnecessary. The line becomes consistent and agrees with the examples if you only change it to:

    For each character in the string, replace it with the number of times that you have seen this same character [ now | as of now | thus far ] since the beginning of the string.

    and/or something such as

    From the beginning of the given string, change each character's Nth occurrence/appearance to that number N.

    then the examples make clear it means 1-indexed and not 0-indexed.

  • Custom User Avatar

    Give an example of ${thing}

    is not a question.

  • Custom User Avatar

    for some raisin, I thought it should be from M to M+N and not from 1 to N. that was dumb...

  • Custom User Avatar
  • Custom User Avatar

    i added this fixed test to C.

  • Custom User Avatar

    (C translation)
    I had a bad approach to accepting the sign which completely passed the full tests but correctly fails after I added this to sample tests:

    do_test(".+25", false);
    

    There is of course already one like it:

    	do_test("2.+25", false);
    

    but my original way of permitting the + handled that one "accidentally correctly" by noting that there was a digit before it without bothering about its position in the string. After fixing my solution I hacked it back into a fork, which shouldn't have passed.

  • Custom User Avatar

    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.

  • Custom User Avatar

    What do m and s even represent?

    past or present denominators, or defaults

    If the value before the most recent left choice was l/m and the value before the most recent right choice was r/s then the new value will be (l+r) / (m+s).

    That line, paraphrased / decoded / whatever:

    (l+r)/(m+s) is each new fraction (next iteration), before substitution and simplification. Let l/m represent whatever the fraction was, just before you most recently parsed an L choice. Let r/s represent whatever the fraction was, just before you most recently parsed an R choice.

    This is how values of l, r, m, s are obtained most often. But l = 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 initial 1/1, corresponding to the empty string, is formed entirely out of them).

    HTH

  • Custom User Avatar
  • Custom User Avatar

    It seems to be. Thanks!

  • Custom User Avatar
  • Custom User Avatar

    should be fixed, can you check ?

  • Custom User Avatar

    The sample test

    test.assert_equals(solve("codingIsFun",2,100),"conuFsIgnid")
    

    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.

  • Custom User Avatar

    "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?

  • Custom User Avatar

    In C, random tests seem to be pulling in & also reversing the null terminator, thus truncating the "expected" string.

    a = 13, b = 14
    string =   "oWcZBIOiwforzI"
    expected = "oWcZBIOiwforz"
    actual =   "oWcZBIOiwforzI"
    
    a = 0, b = 11
    string =   "RzMWhjXMSkA"
    expected = ""
    actual =   "AkSMXjhWMzR"
    
    a = 2, b = 6
    string =   "VAXDkc"
    expected = "VA"
    actual =   "VAckDX"
    

    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.

    fixed_tests
    random_tests
    a = 0, b = 1
    string =   "Q"
    expected = ""
    actual =   "Q"
    
  • Loading more items...