Ad
  • Custom User Avatar

    Done. That should hopefully make things clearer.

  • Custom User Avatar

    I've modified the tests to be more clear. I've enhanced existing ones and I've added a few negative tests as well.

  • Custom User Avatar

    I updated the description to be more clear. I've also enhanced the sample tests to help clarify.

  • Custom User Avatar

    I don't see why Random test cases are an absolute necessity.

  • Custom User Avatar

    I have improved the wording in the description to now say: "Numbers should preserve their sign; i.e. a negative number should still be negative when reversed." This should be clear enough.

  • Custom User Avatar

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

  • Custom User Avatar

    It does say "Negative numbers should be preserved."

  • Custom User Avatar

    Yes, unfortunatly I left this in draft status while some of the others were created and just published this without realizing there were several more. Some that previously existed were not sufficiently similar in my opinion to be considered duplicates (e.g. "Palindrome for your dome").

  • Custom User Avatar

    It means non-alphanumeric. A couple of the tests contain non-alpha characters.

  • Custom User Avatar

    Thanks to heyitsmattwade I realized the "trick" I missed; checking for c === 0.

  • Custom User Avatar

    I don't believe so, unless I'm misunderstanding how JS is behaving.

    I intend to compute it once per function via: var sqrt_discrim = Math.sqrt(discriminant);
    I then use the value of'sqrt_discrim' to compute both solutions; -b + sqrt_discrim ...

    Without seeing the Test Cases, are there 5 that require the calculation of two real solutions? Am I missing a trick with one that would require me to not have to perform the sqrt() call?

  • Custom User Avatar

    Having issues passing the minimum allowed number of Math.sqrt() calls. It's telling me I have 5, but it needs to be 4 or less. I'm at an impass on how to reduce the problem further. My code passes all of the tests, except for this one. I am checking the discriminants first and only computing sqrt() for the case of two real solutions. I thought perhaps it was the case of sqrt(1) that may be uncessary and easily bypassed, however, that doesn't seem to be the case. I'm now stuck trying to figure out how to satisfy this black box's issue with having an extra sqrt() call. Any suggestions?