Posting a new thread as reply to the question prompt:
I’m walking through this example with the worst case [1,1,1,1,1,1,1,1,1,1,1,1] and I feel like this is O(N^3)? (target = 4) The inner inner loop is guaranteed run for the full range regardless of sort. Is O(N∗logN+N^2) correct?