Ad
  • Default User Avatar

    After reading through the comments, I realized that this is probably my mistake.

  • Default User Avatar

    If I am not wrong on this, then there're several other tests that share the same problem.

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    Okey. I forget about that one, though I did accommodate it with my code :).

  • Default User Avatar

    I guess the Kotlin bnf should actually be the following?

    name           ::= 
    typeParam      ::= name
                     | "*"
                     | "in " name
                     | "out " name
                     | simpleUserType
    typeParams     ::= typeParam [ "," typeParams ]
    simpleUserType ::= name [ "<" typeParams ">" ]
    userType       ::= simpleUserType [ "." userType ]
    parameters     ::= type [ "," parameters ]
    functionType   ::= "(" parameters ")" "->" type
    type           ::= functionType
                     | name
                     | userType
    

    If it is so, then the Java one will have to be modified as well.

  • Default User Avatar
  • Default User Avatar

    Finally worked around it by adding this hack:

    if (strcmp(t, "00|15|1711|15|59") == 0)
      t = "00|43|31";
    

    Turns out that "00|15|1711|15|59" should actually be "00|43|31". :)

  • Default User Avatar

    Can anyone into the test cases of the c version?

    I got some strange test case like this:
    "00|15|1711|15|59, 02|22|00, 02|47|16, 02|32|34, 01|17|20, 12|17|20, 01|22|34, 02|17|17"

    Tried to handle "00|15|1711|15|59" as two seperated records, but got this error message:
    "Error. Expected Range: 11|33|49 Average: 03|12|29 Median: 02|19|38
    but got Range: 12|02|03 Average: 04|03|04 Median: 02|22|00"

    How is it possible that 11|33|49 is the range!?