Ad
  • Custom User Avatar
  • Custom User Avatar
    RandomTests
      n = 5967739729065728588
        Expected: equal to 5967739729065728858
        Actual: 0
    

    The only way to return 0 from your solution is when it catches and silences an exception. Generally, your code seems to throw exceptions left and right, and then forcibly silences them.

    There is quite a lot of fixing to do. Removing all try / catch(...) would be a good first step.

  • Custom User Avatar

    If you got a message that "Expected: 19009 Actual: 10990." and then you put 10990 in your IDE, then you read the tests an failure messages wrong. "expected" is what tests want you to return, "actual" is what you returned, and n = XXXXXX displayed in an assertion message is what you should put in your IDE.

  • Custom User Avatar

    Print the input: https://docs.codewars.com/training/troubleshooting/#print-input In the error message, actual is what your function returned instead of the expected value. Without the input we can't tell if your code is right or wrong.

  • Custom User Avatar

    My solution works correctly in clion on laptop , but when I copied my solution and tried it , I got an error:
    Expected: 19009 Actual: 10990. When I putting 10990 in clion , my solution returns 19009. I actually tried to copy it about 3 times and all another cases is OK, so what type of problem I have and maybe somebody knows what to do?
    P.S.: I also got an error/warning for using atoi(). What is atoi() problem and why I should refuse to use it?