Ad
  • Custom User Avatar

    Either way, really fun kata! Thx.

  • Custom User Avatar

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

  • Custom User Avatar

    Thanks for pointing that out! Messaging now updated.

  • Custom User Avatar

    Got it. Insight much appreciated.

    Ok, rather than rewrite the kata, I just updated the instructions to reflect that, in this case, only integers are acceptable. Also included a method to convert negatives to positive and drop any decimals. Added additional Test.assertEquals() for negatives and zeros, and will use those Test methods going forward. Thanks.

  • Custom User Avatar

    Thanks for your suggestions. It's my first authored kata. Question: If I update the function so it only accepts positive integers, would it break the attempts submitted by other members, or rather, make them invalid?

  • Custom User Avatar

    Thanks a lot! I used it in a project a while back, and remember there being a multitude of ways to achieve the same result. Never tested for performance or edge cases, so thought this would be the perfect place to submit it.

  • Default User Avatar

    A worthwhile exercise here, with many different solutions. Learned some better alternatives to the one I presented. Would also be interested in performance comparisons.