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?

  • Default User Avatar

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

  • 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

  • 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