Ad
  • Custom User Avatar
  • Custom User Avatar

    That's most likely your code's problem. Please check again.

  • Default User Avatar

    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:(

  • Default User Avatar

    Beautiful Kata!! So fun solving it lol:)

  • Default User Avatar

    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:)

  • Default User Avatar

    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?

  • Custom User Avatar

    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 your c 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.

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution