Ad
  • Custom User Avatar

    If you have 20 customers and 1 guy - iterations of outer and inner are 20.
    if you have 5 customers and 100 guys - iterations of outer and inner are 500.

    So simply O(customers.size() * n).

    The thing you have to note here is that n is "int", so the solution is more than acceptable.

  • Default User Avatar

    But you need one vector of each size anyway. Here the vectors are moved to the result, in your solution they are copied instead, so you have one extra vector in the end and copying instead of filling with subsequent moving.