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.
but in my ide, i get expected for all of them, any help please? im working on c!!
Call for help!Thanks!
Exit code : 139
Response received but no data was written to STDOUT or STDERR.
Your solution has O(n) complexity, because you count all numbers in order. However, the range can be very big.
Instead, try to decompose the problem into the following:
count all ones in binary representation in range (0, n)
count all ones in binary representation in range (0, number of special form)
Your solution is way too inefficient.
This comment is hidden because it contains spoiler information about the solution
Great. Simply and deep in same time. Thanks.
C++ seems have the same problem.