Ad
  • Custom User Avatar

    Resolving then.

  • Custom User Avatar

    I have copy pasted your function and it still throws that error. Then I have deleted all the code before it (a class and two functions) and now the function is found. I still can't figure what can be wrong as long on my PC everything work as expected.

    LE: I let my entire code there in case you can look at it. That class is the problem. If I delete the class, the function is found but the class doesn't. If I add the class, the function is not found.

    LE2: Maybe I should make this an issue not a question.

    LE3: I can rewrite my solution without using classes, solving the kata, avoiding this
    error but the problem will still lurking on the site. :) Please help me to help you. :)

    LE4 (final):
    I used "objects" made by arrays with references to them instead of classes and I have passed the test.

  • Custom User Avatar
    function sum_intervals(array $intervals): int {
      return 1;
    }
    

    That doesn't return the correct answer (obviously) but doesn't throw that error. Are you sure your function's name is ok?

  • Custom User Avatar

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

  • Custom User Avatar

    Most precisely, A to Z is uppercase only.

  • Custom User Avatar

    You can't delete it, just leave it.

  • Custom User Avatar

    I see. Thank you! Now, should I let this suggestion here or should I delete it? (Not sure yet if I can delete it :) .)

  • Custom User Avatar

    the duration is expressed as a combination of years, days, hours, minutes and seconds.

    There is no months there, so no mention is needed at all.

  • Custom User Avatar

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

  • Custom User Avatar

    If I'll ever resolve this I will give it a negative review. After all I am here for programming not guessing. Good the fact I decided to read here. Now I know that it is not about the solution but about the question. The difficulty must be in programming not in guessing what funny someone wants.

  • Custom User Avatar

    Wh do you ask this in Cheat Detection...!??

    1. the tests you see are sample tests. When you click "attempt", there more of them
    2. yes, that's the usual/normal way to do it.
  • Custom User Avatar

    I have two questions.

    1. I work in this way: on my system I write the code until I think it is ready to test it. So then I copy the code here on site. If it do not pass, I modyfy the code in my system and repeat the process. Is this cheat? Just because some script detects a copy-paste? I need to know that.You can see that my solutions are unique.
    2. Sometimes I wanted to see the input from test cases. Using console.log () in my solution (or var_dump, etc). Is this allowed?
      Thank you!
  • Custom User Avatar

    That last element is missing only on your site. I tried that input on my system and the last element is there. Because tle last element on my system is in the output I can't "debug". But, without changing the code, I tried again and again the "Attempt" button and my solution was accepted. Because I did not changed anything in code, I still think the problem is with tests or site. But not a problem of me anymore. Anyway, good kata. Thanks.

  • Custom User Avatar

    I tried several solutions and they worked fine. There is sommething wrong in your code. It seems that the missing element is the last.

  • Custom User Avatar

    I think it is a problem with managing test cases. For the same input on my machine outputs the correct answer but on this site don't. Look three of them. Usually passes more than 100 tests but one or two. Again, on my machine the output is the same as "Expected" on your site.
    [ -29804, -4209, -28265, -72769, -31744 ];
    [ 107, 158, 204, 100, 118, 123, 126, 110, 116, 100 ];
    [ 151, 182, 124, 49, 4, 90, 74, -64, 191, 158, 144, 104, -35, -93 ];

  • Loading more items...