Ad
  • Default User Avatar

    I just checked your code (your current solution that is visible at least) and it seems to pass all the tests to me?

    So it seems tests are OK - maybe you were reading logs incorrectly: the error message always appears below any console output for that given test so here you were probably reading the results for the previous test with n = 23 which expects False?

  • Custom User Avatar
  • Default User Avatar

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

  • Default User Avatar

    In python, my solution finds 27 to a cyclops number. Bu the test says "True should be False".

    Is this a known issue?

  • Custom User Avatar

    My piece of of advice:

    1. Don't get down because of other people's solution, because no matter your skill level it is very likely that someone else could do better than you! I enjoy reading other people's solutions and regard that as my reward for solving a kata.

    2. As a general introduction to coding and problem solving I recommend Prof. Peter Norvig's free online course (you can easily google it), the lessons and exercises will teach you to reflect on your solution strategy.

    3. Take your time and practice, and make sure you learn the in and outs of your preferred language, so that you can focus on problem solving.

    Good luck and happy coding!

  • Custom User Avatar

    I'm not a great coder (just adding that up front), but I have used the Kata to get better (I think, and hope). My approach is to solve the problem however I can. Once I have code that is good enough, I go back to it and see if I can tidy it myself. If not, fair enough. Submit, and then I read other solutions.

    For the other solutions I read and try and udnerstand them. I try and work out a the solution seems to be showing off (just trying to use the least lines of code for reasons I don't understand), or if they are doing something I would like to learn.

    If a solution is doing something I want to learn I may try and use that on the next kata, or just go and read up on it.

    Every so often I go back to solutions I wrote long enough ago that I think (hope), I am know significantly better. I then try rewriting with my current knowledge. I leave it awhile because if I have just learnt something new from another solution and try using it, chances are fi am just copying someones elses approach, not really understanding and applying it.

  • Custom User Avatar

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

  • Custom User Avatar

    Hey @ccombe I also hit the recursion limit and was able to get around it by combining the repetitive operations. I recommend printing the inputs and looking in the logs for a pattern :)

  • Custom User Avatar

    If it's worth anything, I can tell you i don't think this kata is 7 kyu. I think that even if solution looks simple, it's not THAT easy to get to it. Don't get discouraged, and keep trying :)

  • Custom User Avatar

    OK looks like I can get past the repeating line error and now I can solve 116 with 91 failing and it seems to be there I have largeish numbers that don't quite get clos enough to eachother. Time for bed - ill keep trying tomorrow.

  • Default User Avatar

    Thanks that is helpful but it's almost midnight here and I'm running out of ideas.
    I think I need a way of being able to check if the line will repeat again (many times) because the value or either a or b is so large that it needs to be reduced significantly.

    I woudl think checking to see if the difference between the a and b is > 3 * a or 3 * b, then set a = 2 * b or b = 2 * a but that doesn't feel right.

  • Custom User Avatar

    Note how in previous post you have this: [previous line repeated 996 more times]. Maybe you could find a way to avoid so many identical lines? It should not be difficult. But yeah, I wonder if still in scope of a white kata...

  • Custom User Avatar

    I'm losing my mind on Python.

    I keep hitting the recursion limit which seems like a Python gap compared to other languages but then I assume I'm doing something stupid with my logic - however I see a lot of others having the same issue with the same test.

    solve(100000000000,3)

    Any suggestions for how to best approach solving this or if there's a specific feature / approach to trye would be appreciated.

    Should I be looking into generators and yields as an alternative?

    Amy suggestions / tips are appreciated.

  • Custom User Avatar

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

  • Custom User Avatar

    hitting a recursion limit is a problem of your solution

  • Loading more items...