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.
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.
Thanks, i think '__builtin_popcountll()' that im using in part of the code maybe the source of this.
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.
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.
c
Language?
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!!
nice ,with abs(lng - wdth) you won't need the ifs