Ad
  • Default User Avatar
  • Default User Avatar

    Since you're working in Python it seems: I've solved this in Python using your approach and it works fine - I've also double checked the results that you have problems with on Wolfram Alpha and they agree with the Wolfram Alpha results.

    I'm not sure how to help you specifically without seeing your code - I'd recommend checking things like integer division/rounding of square roots as that's probably the only place where you might be making small mistakes.

    update - I forgot to mention; seeing that both your results are "overcounting" the correct result, it's possible that your code isn't taking into account reduced fractions i.e. maybe you are double (or triple, etc.) counting "the same" fraction - make sure that e.g. you don't count 4/10 and 2/5 as 2 different fractions for example.

    By the way I've spoilered your comment since it contains the "name" of the key concept that solves this kata - as it is 4 kyu I think it's fair that people should work a bit to earn their points.