Ad
  • Custom User Avatar
  • Custom User Avatar

    Changed sum in description and initial code to total

  • Default User Avatar

    In Python, it's not recommended to use the variable name "sum" because it is also the name of a built-in function sum(). If you use "sum" as a variable name, it may override the built-in sum() function, making it unavailable for use within the same scope. For example:

    def zero_count(sum):
        return sum(range(10))
    
  • Custom User Avatar
  • Custom User Avatar
  • Custom User Avatar

    Lol well played to you I thought you had the win

  • Default User Avatar
  • Custom User Avatar

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

  • Default User Avatar

    What's the deal with size_t, does 1e9 change its value depending on the platform?

  • Custom User Avatar

    Ok, thanks! I changed the description, and I hope it's alright now.

  • Custom User Avatar

    Again, the task isn't that hard that the description is absolutely necessary to solve it.
    And again, I think that's the specific reason why "others don't have a problem with it": they just did like I did: they totally ignored the description to find out the way to solve the problem looking only at the pictures. The only thing is that they didn't talk about it. ;)

    Yes, that new picture finally allowed me to understand what your were describing.

    I'd suggest the following modifications:

    1. First you paint the inner square, with a side of k.
    2. Then you need to paint one pixel on the bottom right of the the bottom right pixels you just painted. Let's call it the "bridge".
    3. Finally, you will need to paint the outer shape, connected diagonally to the "bridge".

    (note: With this, I'm not even sure it's still needed to name the "bridge", and I'm not sure the new picture is needed anymore)

    Cheers

  • Default User Avatar
  • Custom User Avatar

    I'm sorry, but I can't quite understand the point, and I can't just "completly" reword the description. Other seem to have no problem with it, and there is even the image that shows the pattern for different sizes. Can you please explain what exactly you want me to change? That would be also helpful if you explained how you resorted the pattern, so I can understand the problematic points that the description has.

    P.S. I can also you this image, if it would be better:
    Image

  • Custom User Avatar

    Hi,

    would it be possible to completely reword the description...? Because, well... I understood nothing to the steps to draw the shape and totally resorted to pattern matching. And I bet that's what most users did...

    Cheers

  • Custom User Avatar

    This is just a glorified knapsack problem with additional flair wrapping the core task. There are already many published knapsack katas.

  • Loading more items...