Ad
  • Custom User Avatar

    Thanks, i think '__builtin_popcountll()' that im using in part of the code maybe the source of this.

  • Custom User Avatar

    It's strange you get the right answer in your IDE and not here. It would mean the C implementations differ, some difference in the compiler... I'm not an expert so I can't say for sure but I don't even know if that's possible. I guess there must be some difference somewhere (a variable with a different type or something like that). So I would suggest first to double check that, and also have a look here: Troubleshooting Your Solution. After checking it if you cannot find the problem you may post your code with a spoiler flag and someone may help you (with no guarantee). There are many ways to solve this kata so it's hard to help without more informations.

  • Custom User Avatar

    Hi. A problem with your code is not a kata issue. You'd rather post a question if you want help.
    Hopefully this can help you: Troubleshooting Your Solution.

  • Custom User Avatar
  • Custom User Avatar
  • Custom User Avatar

    help please
    Error: countOnes(52868585, 68127216)
    Expected: 214418586
    Got: 214419282

    Error: countOnes(143852667, 147469842)
    Expected: 47992140
    Got: 47992820

    Error: countOnes(239138, 747794)
    Expected: 5047947
    Got: 5048667

    Error: countOnes(439665, 651596)
    Expected: 2131572
    Got: 2132156

    Error: countOnes(780302205, 780695789)
    Expected: 5838166
    Got: 5838918

    but in my ide, i get expected for all of them, any help please? im working on c!!

  • Custom User Avatar

    nice ,with abs(lng - wdth) you won't need the ifs