Ad
  • Custom User Avatar

    Hi,

    Prime numbers have nothing to do with it. The minimum should be just the sum of all numbers in the sequence ;)

  • Default User Avatar

    So i have been looking at the sequences for so long. I have come to the conclusion that the number you swap should create the smallest prime number possible when you add up all the numbers in the sequence (this is what i thought the pattern was). However when i run my code i get the error... [1,1,1] should equal [1,1,2]... i thought it would be [1,1,3] (as the total 5 would be prime) So i am completely stumped and in dire need for some assitance. I cant crack the sequence :(

  • Default User Avatar

    try to understand the patter for the sample case,its very easy just spend some it analyzing it

  • Default User Avatar

    are you returning a pointer to a dynamically allocated integer array?

  • Custom User Avatar

    Had a question on the C test functions. It looks like my program is working. I printed out pre-sorted array, sorted array, and altered array. It looks all correct. However, when the test function calls free() I get an error "invalid size" and about every other attempt I get a "free(): Invalid Pointer". These errors come at the end of everything in the code. Is it something in the return statement? I'm returning a int* like the function protoypes.

    Curious what the test functions are having an issue with since the only amplifying remarks were hexidecimal values.

  • Custom User Avatar

    reasonning/pen and paper.

    ;)

  • Default User Avatar

    How do you know which number to replace and what the replacement number should be?

  • Custom User Avatar

    To be honest you only need to understand basic vector addition and multiplication, so I suggest to start with that. For some visualization, I can link you something which I created alongside with this kata - click. It's randomized, so whenever you refresh the page, the result will be different. Maybe this will help you see it a little better. I initially intended to link it in the description, but it seemed like an overkill. If you don't want to spoil yourself the solution, then don't look into it's source code (;

  • Default User Avatar

    Hi.

    I'm not a very mathsy person. Therefore i am confused as to how you calculated x=-108.21, y=-66.64 in your seccond example. I understood the first example of how you got 14 but i am completely lost when you apply it to the 2-dimensional plane. I guess i don't know how to work well with the vectors and radiuses. Perhaps you could point me to some material that i need to learn to understand how to do this calculation or if you could offer any help it would be much appreciated.

    Thanks.