Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
As many others, the solution fails for n=625, p=2 (the case from the text). Also, C-style cast...
yeah ig 0 is not pass as argument in test that time. we have to use do while
it is because when 0 is pass while is not run & output blank vector array
use do while so it will works
I'm assuming they added a base case in? cause no way this works now.
i ran your code its wrong for basic test case!!!!!
I don't know why this is best solution. It fails when n = 0.
Similiar to my submit.
But why are you subtracting m%10 from m? The division will get rid of this all by itself, won't it?
why does n / 10 shift to the right?
that's not so clever
I had similar, not sure why people insist on the string conversions
The program fails the test when n = 0.
The LSB and the last digit aren't exactly the same thing.
i
should be ofsize_t
otherwise you can get (with -Wall)signed unsigned comparison
. Also with a sufficiently largex
your loop will never terminate.I'd highly suggest using just "while(n)" rather than"while(n!=0)" since every integers except 0 counts as 'true'.