Ad
  • Custom User Avatar

    (3): Don't print anything inside the loop, otherwise you would fail to pass complex tests due to the max buffer limitation.

    Thank you for this.

  • Custom User Avatar

    To help clarify the problem, here's some tips:
    (1): For "MOV x y", be careful about this information: "y is a constant value ! or ! a register) ".
    (2): For "JNZ x y", similar information goes to both x and y here.
    (3): Don't print anything inside the loop, otherwise you would fail to pass complex tests due to the max buffer limitation.

  • Custom User Avatar

    Comment from @victordfb saves me a lot time debugging! You're brilliant!

    BTW, Exit139 bothers me all the time in CW. I think this error message might be equal to "segmentation error". eg. trying to access a empty vector.

  • Custom User Avatar

    So many interesting tricks in this solution. Learned a lot from it. Thank you!

  • Custom User Avatar

    I think this one is better than the current best solution, since it's O(n), whereas the best solution is O(n^2). Am I correct?