Ad
  • Custom User Avatar

    i mean, the obvious thing to do would be to loop through the sum of the weight digits and order them by value and if you find any case where you have duplicate values, then order the duplicate values by their "original numbers" alphabetically. example:
    "90" = 9 + 0 = 9. "180" = 1+8+0= 9. since both values(sum of the original weight) are 9,you sort them by their original weights instead of values, which is: "90 < 180" (in this case,is false because 90 is greater than 180 alphabetically. ) then swap their positions in the string or sort their positions how you deem fit.

  • Custom User Avatar

    C++ Completions 6094

    Add a new line when printing the input, that's the input of several tests together. The tests are fine.

  • Custom User Avatar

    I think this kata might be bugged for c++. After passing the test and failing the attempt. I printed out the result so i could pinpoint where my code was wrong. Below is the error,passed random test and failed basic test:

    " IsValidWalk
    BasicTests
    Log
    nnsnsnsnsnsnsnsnsnsnsnsnsewewnsnsewnsewnsewnsewnsewnsewnsewnsnsewnsewnsewnsewnsewsewnnsewnsnsnsnsnsnneeewnsnsewnenenenene
    Expected: false
    Actual: true

    RandomTests
    Log
    wssnwnenseswnwenwweeseenwwwsswnsneweweswesenwnnwwnessseenwnesseswenewwsenesswwnseensnenesswnwewsewssnwnsnesnwssnwweewneewssewweswwnnssnssnnsessnwnnsennewwwnwnsessnsneewewwswwswnnwsnwwnswesennwenwwsensnswnwwesnwwewenesnewewwwweneeswseswenwswneswnnsswsnenewssewenweeenswwewwsenneeesnssnsssssewsewwnnssnswesnnssnwswwenwwwsnsseswennwwweweesenwswesnnnesswewwweneeswewnsnsnesnwessnewnnssweesnnnswwnwesnnw
    Test Passed "

    So i moved to Visual studio and ran the given output log on the same code and the results were correct. For instance,the failed basic test expecting "false" test on codewar ended up being "false" when run on visual studio with the same log. I collected more logs and ran several instances,and the result were correct and correspond to the expected result on codewar.

    This makes me conclude, there is a chance this kata might be bugged for c++.

    if you look at both logs above,the directions are way more than 10 minutes walk. I have a condition that immediately returns false if the given time for the walk exceeds ten minute. So it doesn't make sense one of both test is wrong and the other is right. Tried three different ide environment and the result again was correct,matching the expected result in the log. So please look into this.