Ad
  • Custom User Avatar

    I think you should limit below 0 and upper 255

  • Custom User Avatar

    Hey. I don't know how it's in JS, but in Swift a tuple is an anonimous objest with syntax (index1: Int, index2: Int)
    I also got confused with this moment. The author ment an array of ints.

  • Default User Avatar

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

  • Custom User Avatar

    yeah, totally true. No actual example in mind, mostly an almost random thought...

  • Custom User Avatar

    care to mention which exactly? sounds like domain specific use case, I referred only to general use cases

  • Custom User Avatar

    any builtin is faster...

    (unless you achieve better time complexity and the inputs are large enough. Very "large enough", sometimes... x) )

  • Custom User Avatar

    any builtin is faster than whatever equivalent of it you try to recreate because builtins use c implementations and skip the whole 'handling useless calls from outer layer' part

  • Custom User Avatar

    Likely because it has been highly optimized over the many years it has existed and it was probably written by someone a lot smarter than anyone here .

    Generally it isn't worth it to go so deep that you are re-inventing the wheel.

  • Custom User Avatar

    I don't know all that much Python. I suggest you just look at the other solutions and take inspiration from them. You can even vote on which one you think is best or most creative.

  • Custom User Avatar

    What programming language is it? And what is wrong with your code? Which test is it failing or what error message is it coming with?

    If the code works and you just want to see other people's solutions, go to the Solutions tab and you can see how others solved this Kata.