Ad
  • Default User Avatar

    thanks for reply yes i now see that i made it far too complicated i just refactored it into something so much simpler

  • Default User Avatar

    considering im a new programmer, most of hard level 7 katas i just quit within 15 minutes but this one i pushed through for almost an hour and managed to somehow solve the problem, the code is rather long compared to the top answers but the big O notation is O(N) which is the same as the top answers, so it does have the same runtime efficiency, not sure about the space complexity but im pretty proud of this one considering im writing this long ass comment which no one will read about how much dopamine getting this function brought me. If you have any suggestions other than "use this library and just do this one liner which i copied of a stack overflow answer not knowing what it does" im happy to hear!

  • Default User Avatar

    i think i went a bit overboard lol

  • Default User Avatar

    feel kinda dumb lol