Ad
  • Custom User Avatar

    I like this. I didn't know about the maximumBy so I had to zip the words with their scores, sort and find the head. Thanks for making me better at haskell :)

  • Custom User Avatar

    gauss' sum > everything else i learned in school

  • Custom User Avatar

    This problem is really making me think. Haven't figured it out yet but I'm getting close I can FEEL it

  • Custom User Avatar

    This is great!, I got it down to one for loop by modifying gauss' sum slighly different. But this is true algebraic problem solving! :)

  • Custom User Avatar

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

  • Custom User Avatar

    Yeah I did something similar, regex I used is: std::regex expr("[:;][-~]*[)D]");
    Though this matches to faces with multiple noses. Like yours more!
    (I wasn't aware of "?" in regex's until I saw this)

  • Custom User Avatar

    I have this issue as well and removing pow did not seem to fix the solution. I am confused because when I put that test case into an online compiler and used cout to get my result (with both old and new code) findNb returned 45001. Is there any other reason why the test wouldn't accept it?

    Added "testequal(ASum::findNb(1025292944081384960), 45001);" to test1 and it passed.
    Used cout and found that the number given in the test 6 is "1025292944081385001" which does not evaluate to 45001, correct?

  • Custom User Avatar

    If anyone else is still having this issue dont use the pow function, it cant handle the large numbers that test 6 produces so just square it without pow and you should pass the test!

  • Custom User Avatar

    Same seems to happen to me, I have checked for some kind of optimization to solve it, but can't find anything wrong. Is it a bug? Any help?

    If it helps, findNb 102525193459636447530260 (which is the last successful test case) takes 1.42 secs to calculate in ghci.

  • Custom User Avatar

    No bug: look at the top of the page to see how many guys paased the C++ kata.

  • Custom User Avatar

    c++ 45001 solution bugged

    used cout to debug it and my -1 should be corrrect.

    so I tried just changing my logic to return 45001 (as it said) just for that test then it told me the expected solution was -1 (as my original logic had)