Ad
  • Custom User Avatar

    Even if intermediate imprecision is avoidable, the kata may invite such imprecision, or it may be too much to ask of solvers to avoid it without a specific mention in the description.

    Note that your solution uses / and Math.ceil, which means the answer might now be off by one instead of off by a very small number, and the tests do not make any allowances for that.

    Floating point operations are inherently imprecise, and the only way to deal with that is using approximate comparisons; any rounding has the possibility of introducing errors.

    But I'm still not reopening a 6 year old Issue.

  • Custom User Avatar

    I was referring to using only intermediate rationals, yes. Looking back at my solution, in fact, I seem to have used only intermediate integers.

  • Custom User Avatar

    Working in python, it seems that the test has integers inside nested lists.

    ''' The content of a dictionary item is not correct: [42740748] should equal [[42740748]] '''

    This is also causing a TypeError, can't compare 'list' to 'int'

    Looking at the rules and examples, the result should be a list of ints, not a list of a list of ints.

  • Custom User Avatar

    Approved

  • Custom User Avatar

    python new test framework is required. updated in this fork

  • Custom User Avatar

    Type error in description

    // result should have this content: {"A": [1, 3]}, "B": [2]}
    
  • Custom User Avatar

    I think you are wrong ( unless you use intermediate rationals instead of floating point numbers. but JS has no native rationals ).

    But I am not reopening a six year old issue.

  • Custom User Avatar

    Issue resolved at some point in the past; tests now compare only integers and an integer solution can be calculated with no floating-point intermediates.

  • Custom User Avatar

    55 kg, 10% scrap ==> 5.5 kg scrap ==> 49.5 kg ==> no robot

  • Custom User Avatar

    This was my answer except I got an error for not having the ? after n, and I couldn't figure out how to fix it. Thank you!

  • Default User Avatar

    nice solution, I just dislike how you've written the IsPrime function. The if that everything is wrapped in could easily be replaced with another guard clause. You did use guards so you seem to know that guards are prefered when using ifs.
    how about if input is 2 return true, if input is 1 return false? so that catches the only edge cases I have in mind right now with a nice guard clause and then you can keep your approach without nesting everything into an if check.

  • Default User Avatar

    Why is the second argument when calling iterate the function with the tail value? Why not just Iterate(f, x), since that's the parameter order. Idk this one confuses me.

  • Default User Avatar

    It's probably been a long time since you did this kata. I'm trying to understand your recursion but i keep getting lost in the way. Would it be too much to ask for your help?
    I had to at least try asking.

  • Default User Avatar
  • Custom User Avatar

    it's the range operator, he's taking the quotes elements starting from i till the end of the array

  • Loading more items...