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.
That's most likely your code's problem. Please check again.
I think looping upto n/2 helps only for even numbers till n , like for n=20 , looping upto 10 will do for even numbers upto 20 , but it will not be useful for odd numbers like 17,13,19,because they are not divisible by two and their collatz needs to be calculated separately ,i dont understand what to do:(
Beautiful Kata!! So fun solving it lol:)
Every prime number except 2 and 3 is of the form 6k+1 or 6k-1 , this property can be used to avoid unnecessary looping:)
I am passing the test cases , but after i try the attempt cases , i get this error--> Response received but no data was written to STDOUT or STDERR.
SIGKILL
Process exited prematurally with a SIGKILL signal.
Can anyone please help me out what this means?
Return
breaks it out of the for loop and returns the result. That means it will only loop once and look at the first character in the sequence. You can see this if you print out yourc
variable. The return statement needs to be after the loop has finished to check every position in the postcode. The tests you are passing are only because your code always returning false and will pass for any tests if false is the answer. Please mark this as a question and not an issue next time.This comment is hidden because it contains spoiler information about the solution