Ad
  • Default User Avatar

    Alright! Thanks for replying :)
    now that i can be certain, i'll try to minimize my memory usage.

  • Custom User Avatar

    C++ version of the kata seems to be OK. However, it's true that is seems to be somewhat more demanding than, for example, C# version. My approach I used for C# did not pass C++ tests, I had to improve it a bit.

    If you get timeouts or crashes, they are probably caused by your solution not being as efficient as you think. Compilation warnings are "just" warnings and probably do not affect the final outcome of the tests. They should be removed nonetheless.

  • Default User Avatar

    Following these warnings - I've tried both recursive and iterative solutions (both sufficiently efficient)
    on my local machine and they both seem to work on all test inputs while on codewars the tests keep crashing..
    I get either a double-free corruption or a stack-overflow, please someone let me know if its a bug or not.
    Thanks anyways!

  • Default User Avatar

    Not sure if its an issue but the c++ tests seem to produce warnings that isnt in my code:

    main.cpp:62:30: warning: comparison of integers of different signs: 'int' and 'std::vector::size_type' (aka 'unsigned long') [-Wsign-compare]
    for(int i = 0; i < coins.size(); i++)
    ~ ^ ~~~~~~~~~~~~
    main.cpp:63:37: warning: comparison of integers of different signs: 'int' and 'const unsigned int' [-Wsign-compare]
    for(int j = coins[i]; j <= money; j++)

  • Default User Avatar

    First of all thank you for the fast response!!
    I assure you i did not reported this issue so easily i guess besides that "false"
    (which i tried before) something else is slightly wrong with my solution. :)

  • Custom User Avatar

    JS. Not an issue, you just misinterpretaded the feedback. This grid obviously has no solution, so you should have returned false. If you did, the assertion function would have returned "Passed!", but instead, your code returned an array of three elements (while 4 bulbs on the map), hence your solution is considered incorrect.

    cheers

  • Custom User Avatar
  • Default User Avatar

    There seems to be something wrong with the tests, i always get like 100+ success and some 5-8 fails that always look like they should be false
    but it claims it has at least one solution: (no spoilers)
    https://pasteboard.co/JxbjlGK.png

    take a look and tell me this one has a solution please,
    Nadav.