Ad
  • Custom User Avatar

    Thanks, I'll try that.

  • Custom User Avatar

    not an issue, your code is wrong. ;) (did you considere trying to see what input causes your troubles?)

  • Custom User Avatar

    The best solution is your solution regardless of how many lines you have written. It is still possible to refactor and make it look better. The important thing is that you solved it and its really great man!

  • Custom User Avatar

    Well, look at the bright side: you solved it with 2k LOC, I have no idea how to solve it (did not try tho). Your solution is still better than (non-existent) mine.

  • Custom User Avatar

    The number of lines of code is irrelevant if you are getting the correct result. Mine is a couple of hundred lines half of that is helper functions my solution looks like a caveman compared to the clever ones, but I completed the kata and learned from the clever ones a lot. Do not make your goal to write fewer lines vs clean code that YOU understand. If you have been writing code for a while sure a dozen lines is easy to do. I have to agree 1000-2000 is a bit too much for this kata. My suggestion is that you read the description someone wrote here on the discussion is much clearer than the kata description. Sit down and write the algorithm in a notepad. Maybe even make a flowchart. Also run the test cases and see what's expected. Are you debugging stepping through your code?

  • Custom User Avatar

    Maybe try some easier white kata before coming back to this one.. solutions to this kata don't really need to exceed a couple dozen lines.