Earn extra honor and gain new allies!
Honor is earned for each new codewarrior who joins.
Learn more
  • ??? returning reference to stack variable ???

  • This function is not an error handler nor is it designed to scale.

  • This is neither clever, nor good practice. It might work for the given problem but every addition to this code will break it or force the person to rewrite it the normal way. -rep

  • Ok now.

  • Neat, didn't know you could do that - read the docs!

  • Hey John, funny I came on here as I noticed some of the solutions didn't account for when the triple and the double are different, and I see you already caught it. Nice solution by the way.

  • Test cases (that aren't the sample ones) are only editable in Ruby right now (the others are locked). But nice catch.

  • I am noticing this same problem with python kata. I am passing the 4 examples and all basic tests:

    Test.assert_equals(solve(0,20),14)
    Test.assert_equals(solve(2,200),457)
    Test.assert_equals(solve(2,2000),17705)
    Test.assert_equals(solve(2000,5000),25005)
    

    And, passing about 4 - 8 random tests. However other random tests between ranges of about 500 - 1000, I am failing. There are no timeout issues, my algorithm simply returns the wrong number of primes. Strange how I'm passing some tests yet failing others despite their ranges being within the same numbers?

    UPDATE: I ended up passing this one, without changing my code, similar to the above user, Cptnprice.

  • I suggest adding a test that has different repeated numbers for both input cases.

    For example:

    num1 = 9875222143465
    num2 = 24236884
    
    • the repeats are 222 and 88
    • Should return 0.
    • My code would have returned 1 had such a case existed.

    I don't believe these cases exists because I built code to return True (i.e. 1) for these cases, and didn't realize it was wrong until my code passed all tests, I submitted it, and saw the other solutions didn't account for such cases.

  • I added a more clear description and 1 example test... Also added go translation. Can you approve the updates?

  • I updated description to be more clear on what exactly the return type and string should be since many people have noticed the description with "hello world!" to be confusing. I also added a go lang translation. (Suggestion tag means suggested edits)

  • I wasn't sure why index.html was chopped out from the breadcrumb, yet holidays.html included until I read the instructions more carefully ->

    "if the name of the last element is index.something, you treat it as if it wasn't there, sending users automatically to the upper level folder."
    
  • The function is not designed to handle errors or scale. Thise things can be hamdled in separate function calls...

    To handle the errors you suggest the original template function would have to be modified to have return type pointer (double *) or the errors would be handled before the function call.

  • I think there are two problems here. First of all, the operators (add, subtract, multiply, divide) must correspond to execute the right operation. Yet only the first letter is evaluated.
    This function would return a sum still if I passed in "append" as operator. Furthermore, there is no default return value. Should the operator argument not correspond with any of the given ones,
    this function wouldn't return anything at all.

  • Loading more items...