Ad
  • Custom User Avatar
  • Custom User Avatar

    (Py) I suggest displaying the part of “expected” and “but got” where there is a difference. Apparently, "expected" and "but got" are actually shortened to just under 90 characters.

    In each of my failed tests, the result messages look like this:

    Expected:
    ‘p -= 1;\nif (*p) do {\n  *p += 1;\n  putchar(*p);\n  putchar(*p);\n  p -= 1;\n  put...’,
    But got:
    ‘p -= 1;\nif (*p) do {\n  *p += 1;\n  putchar(*p);\n  putchar(*p);\n  p -= 1;\n  put...’
    

    The displayed part of the two shortened strings of “expected” and “but got” match.

  • Custom User Avatar

    please tell me, how is this syntax called:

    key = 0..__eq__
    

    is this syntax comparable to MMA, eg. Select[list, EqualTo[0]]

  • Custom User Avatar

    In the example in the description, all intervals except the last one have a dif (= upper - lower) of 14. The last interval should be [77, 92 ] and has a dif of 15. The largest observed value is 89. Why should the last interval not be [77, 91]?

    I understand why the upper limit of the last interval cannot be above 100.

    Can someone please give me a hint?

  • Custom User Avatar
    s='?!!?!!?!!?!!!??!!!??!!!??!!!??!!!??'
    s='?  ?!!?!!?!!!  !!!??!!!??!!!??!!!??'
    s='?  ?  ?!!?!!!  !!!  !!!??!!!??!!!??'
    s='?  ?  ?  ?!!!  !!!  !!!  !!!??!!!??'
    

    Again, from left to right. You took the leftmost !! and paired it up with the rightmost ?? there.

  • Custom User Avatar

    It says from left to right, then you start with the leftmost !, and next to it, there is a ?, so that's the first pair you should remove. At least that's what I understand and makes the solution unique.

  • Custom User Avatar

    Could it be that the solution is not unique? Please take a look at these 2 sample tests:

    sample test 1:
    
    s='!?!!??!!!?'
    s='!?    !!!?'
    s=' ?    !!! '
    
    <FAILED::>' ?    !!! ' should equal '      !!!?'
    
    sample test 2:
    
    s='?!!?!!?!!?!!!??!!!??!!!??!!!??!!!??'
    s='?  ?!!?!!?!!!??!!!??!!!??!!!??!!!  '
    s='?  ?  ?!!?!!!??!!!??!!!??!!!  !!!  '
    s='?  ?  ?  ?!!!??!!!??!!!  !!!  !!!  '
    
    <FAILED::>'?  ?  ?  ?!!!??!!!??!!!  !!!  !!!  ' should equal '?  ?  ?  ?!!!  !!!  !!!  !!!??!!!??'
    
  • Custom User Avatar

    you do know that next year has already passed, right?

  • Custom User Avatar

    in py we are given this highly informative error message:

    Value is not what was expected
    

    a greek pythia would say it exactly like this

  • Custom User Avatar

    how funny: replace(",", ",")

  • Custom User Avatar

    My solution is completely nonsensical, but it passed.

    Should that really be possible?

  • Custom User Avatar

    Python: In the description it says: He told you that the sub function may or may not be here, if no sub-function return undefined, ...

    The undefined part of sentence should be replaced by e.g. an empty string in Python

  • Custom User Avatar

    you could use the switch (?x)

    please take a look at my solution

  • Custom User Avatar

    This is not what "in a row" means. "In a row" means that there have to be two or more adjacent "FIRE", and in your example the two FIRE are not adjacent.

  • Custom User Avatar

    Surely I am misunderstanding something because the task has been solved many many times in python.
    The python sample test contains this example (2025 June):

     @test.it("Ex2")
        def basic_test_cases():
            test.assert_equals(fire_and_fury("FIREYYFURYYFURYYFURRYFIRE"), "You are fired! I am really furious. You are fired!")        
      
    

    But in the notes of the description it says: If multiple of the same words are found in a row then plural rules apply.

    Wouldn't one rather expect: "You and you are fired! I am really furious."

    I would very much appreciate a hint.

  • Loading more items...