Measure perfomance of Python code: There are multiple way to measure performance of a python code, one of them is using perf_counter method of time module. The perf_counter method returns the time measured in nano second. Triplet Sum function using for loop and while loop: def find_triplets(nums, target): triplets = [] nums.sort() # Sort the list for efficient two-pointer approach
Continue reading