Ad
  • Default User Avatar

    Great answer! You actually solved it yourself with simple functions and a small loop instead of cheating by importing the solution of someone else(library)

  • Default User Avatar

    What? I avoid this approach on purpose. I try to solve these challenges without googling at all. And if I google I only google small part of what I need. After solving it, I look for good solutions among the answers to learn from. This is not one of them. My answer is horrible, but it shows the actual implementation. The solution of this guy is "google a module that solve the entire problem". But I already know how to google. So I'll have a look for someone further down that actually managed to solve the problem

    Do you really wish you thought of googling? Because that is all this answer requires if you don't have the library name in your head.

    It's like saying "wish I had used chatGPT to solve this problem"
    Sure, you may use chatGPT as a tool in your work, but it would remove entire point of coding challenges

    Solutions like these aren't allowed in most coding interviews. It's not impressive. It does not show skill. It is not educational. At this point I wonder why even post a solution at all? What do you get from it? It's like voluntarily taking a math quiz for fun, but then copy paste all the answers from the solution manual

  • Default User Avatar

    Libraries should indeed be used in real life programming of python.

    The purpose of coding challenges is however, to learn to think how to use algorithms to solve problems. Not to get a working code for a client.

    This guy, using a library to do the entire problem, removed the entire challenge of this kata. He solved a 8 kyu problem at best. It's like getting a math problem and then googling the solution. You learn nothing and getting the answer don't show knowledge or skill. Everyone can google. Importing a library that does litterally the whole challenge... not the purpose of the challenge. Unless you think googling the most easy to understand libraries is super hard, and your goal is to practice them. In that case I suggest going to one of those 75 + year meetings where they teach basic computer knowledge

  • Default User Avatar

    Unfortunate

  • Default User Avatar

    How do I delete this? I cleaned up my code and posted a new solution

  • Default User Avatar

    This was my first 4 kyu. Definitely a best practice solution

  • Default User Avatar

    Yes I agree I don't like rounding, so I did a an unethical workaround.

    But in reality, there is no such thing as 0,3 person. So this 0,3 person can not be expected to grow. Of course 0,3 person should be interpreted more like expected value, with 30% chance of no person and 70% chance of existing. But I understand why the creator could have thought he should not allow partial persons

  • Default User Avatar

    Too broad exception