What is the time complexity of this custom function?
What is the time complexity of this custom function? Question: Is it correct to say that the time complexity of the following code snippet is O(n^2)? My main doubt is whether I can consider triplets.append(sorted([array[i], array[j], twoSum – array[j]])) as constant time since it does not depend on N and is always sorting an array …