Ad
  • Custom User Avatar

    Because sentinal values are a bad idea for many reasons, though you probably already learned this in the 4 years since.

    However I'm still bamboozeled as to why it returns Option<Vec<i32>> as opposed to Option<[i32; 3]>. This isn't an arbitrary list, it's exactly 3 elements. I might even expect Option<(i32, i32, i32).

  • Custom User Avatar

    OP solved it, closing

  • Custom User Avatar

    yes, I had to re-read the instructions 3x before I realized that it's not about "complemantary DNA" but about some arbitrary string manipulation ;)

  • Custom User Avatar

    This kata has been both challenging and fun, and the instructions are very clear! Thank you so much!
    o(≧∇≦o)

  • Custom User Avatar

    Hi there!

    So, I know this is your kata and you are free to do whatever you want with it, but may I suggest you change the type of the 'evap_per_day' and 'threshold' variables? It doesn't make any sense to have them as integers, and it's plain to see that they should be floating-point numbers instead, otherwise you keep losing lots of volume due to rounding errors!

    I know one can (easily?) cast from integers to floats, but what's the point of that added step? It's only frustrating!

  • Custom User Avatar

    Not in your implementation no, but that's the point: why couldn't you accept (-1, -1, -1) as the return value when the second tortoise never catches up? Is there a deeper reason for the Option::<Vec::> return type, or was it an arbitrary decision?

    I'm asking because maybe it's something I should learn.

  • Custom User Avatar

    Because the function does not always return a vector of integers.

  • Custom User Avatar

    Why ask for such a complicated return type though? Wouldn't an array of integers, or even a vector of integers, have sufficed? Why wrap the vector of integers inside an Option?

    Seriously, I spent 50% of the time for this kata trying to correctly manage the return type! That sucked big time!

    (Yes, I've just started learning Rust. Sue me.)

  • Custom User Avatar

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

  • Custom User Avatar

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

  • Custom User Avatar

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

  • Custom User Avatar

    I liked this kata, but I must point out that the complementary strand to 'GATTACA' is in fact 'TGTAATC' and not 'CTAATGT'. The two DNA strands in the double helix are anti-parallel!

  • Custom User Avatar

    Sorry, I don't know JavaScript. I think you would find help sooner if you posted at least part of your code here.