Ad
  • Default User Avatar

    wouldn't this be O(n) time where n = len(a)+len(b)? if we can assume all the map operations (make, insert, lookup) happen in constant time, then you have one loop over the entire array b and one loop over the entire array a which is O(len(a)+len(b)) = O(n)...

    I don't see how this could become O( n(log(m)) ) since you aren't dividing the problem space anywhere (required for log(n))... Am I misremembering how these things work?

  • Custom User Avatar

    Now it is absolutely clear! Thank you for your time and patience!)

  • Default User Avatar

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

  • Custom User Avatar

    Thank you for your reply! I have already checked this issue, really, if one assign object to a variable the copy is stored in this variable, not object itself. That was the point I missed

  • Default User Avatar

    Hi xenialugovaya,

    It's hard to say without seeing your code and how you used the variable, but basically if you copied the value from playerPlaces out to a new variable (currentPosition) and made any changes to it, you'd need to remember to copy it back into the playerPlaces object after the changes. that's the most likely reason it was failing as far as I can guess without seeing how you used it.

    J

  • Custom User Avatar

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

  • Default User Avatar

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

  • Default User Avatar

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