• True, wasn't really thinking of using a method like this in a huge program or O(n) at all.
    If the array was never very long than reallocating wouldn't be all that bad.

  • Also, no need for 'else' statement after 'return' statement

  • You just turned a O(n) solution into a O(nlgn) solution :p

  • Trying to understand how the formula works logically in the example:

    1. So basically 10,320 years ago it was 20 grams of carbon in there.
    2. After the first 5,700 years half is gone and 10 grams left.
    3. After the second 5,700 years, another half would go leaving only 5 grams.
    4. But, we only need to wait 4,620 years. So the ratio would give us 4620 x 5 / 5700 = 4.05 grams.
    5. The remaining amount should be about 5.95 grams.
      Any errors here? Or it's just less accurate than the formula?
  • The point of this program is to learn how to create an object I would assume. C++ introduced OOP (object oriented programming) on top of C so it would be wise to know how to utilize it.

  • I wanted to test efficiency out of all things

    But the efficienty of what? calculations? building a string? There are several entangled tasks in your kata that might interact about the efficiency.

    For now, there is no need for actual performances, in the way that any implementation that isn't doing something wrong about the time complexity will pass. Which is not a bad thing because on this kind of task, you cannot go that much further without entering the dreaded world of microoptimizations (this kind of kata is generally bad). But so, the difficulty is rather low.


  • I could really use some input on how difficult this kata is. I wanted to test efficiency out of all things but I don't really know if the number of cases I have set currently is too high or small. Thank you!

  • I don't quite know what you're asking but if you're asking why I used 5700 instead of 5730 for the half-life is because it seemed easier. There shouldn't be any confusion anyways since I explicitly state to use 5700 has the half-life.

  • Why 5700 should be eaier than 5730?
    On my keyboard there are both 3 and 0.

  • Approved, thank you!

  • I fixed the initial solution. The reference solution is private so it can't be accessed anyways. I created two variables to store the array of strings because if you use the same array and send it to both methods and the person alters the array, it would mess up the array for the other method.

  • Python Translation!
    Im new to python, so if anything is wrong LMK and I will fix it

    • The initial solution should use private final static String[] geese = ...

    • Store the reference solution in a variable

    • Why create two variables to store an array of strings when only one is needed?

  • Just wanted to say I still have this translation that hasn't been approved. It seems like the author of this kata is MIA.

  • Yeah sorry about that. I don't know if it can be changed anymore.

  • Loading more items...