Ad
  • Custom User Avatar

    yeah i think so too. it doesnt really match the test criteria. it should say that for ties it is sorted alphabetically from a to z.

  • Custom User Avatar

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

  • Custom User Avatar

    That's just basic school level maths that any developer knows.

  • Default User Avatar

    Yea I definitely agree. I don't see how this would be used in most developer jobs. And I am confused as to how this is level 6.

  • Custom User Avatar

    its not that bad, just gotta know to solve the quadratic equationz

  • Custom User Avatar

    Use spoiler flag next time please.

  • Default User Avatar

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

  • Default User Avatar

    hey, can u help please? do u know by chance how to convert complex numbers to another type like float?
    cause I wrote a quadratic equation but the output is a complex, so... dunno, maybe there is another formula without this conversion problem?

  • Custom User Avatar

    The +v is because of the reaction time. You have 1 second of reaction time, so if v is maybe 10 km/hr, you have travelled an extra 10 km/hr * 1 sec before you even hit the brakes. The part of the equation that isn't the +v is the actual slowing down part.

  • Custom User Avatar

    Well for one, d is given in meters, and you treat it as if it is a velocity. You don't convert a variable in meters to m/s. Your way of converting looks to be a conversion from km/h to m/s, which would not work in this case, as d is in meters. Also, if you are going to convert d to km in order to solve the equation, you must also convert gravity from m/s/s to km/h/h. Otherwise, you'll have a relatively unusable number spat out of your equation.

    Also, it doesn't look like a variable G is assigned before using it in constant. I'm a little confused about that.

    And it looks like you forgot to add the b^2 part of the quadratic equation, as a part of the determinant. I would take another look at the quadratic formula Here, make sure all of my variables are converted correctly, and try again. Also, look into slightly different ways of doing this. (You don't have to convert before you do the equation).

  • Custom User Avatar

    What are you saying about this? Do you mean that this kata's sensei should have made the argument "v" into an argument called "velocity"?

  • Custom User Avatar

    have i missed the site being renamed to mathwars? this requires absolutely no coding skills

  • Custom User Avatar

    wouldnt this return floating point numbers on division and fail the test, or am i missing something?