mfgnik

Untitled

Nov 24th, 2020
705
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def algo(nums):  # nums: List[int]
  2.     n = len(nums)
  3.     if n <= 1:
  4.         return nums
  5.        
  6.     nums1 = nums[:n // 2]
  7.     nums2 = nums[n // 2:]
  8.        
  9.     result = []
  10.     for num1 in nums1:
  11.         for num2 in nums2:
  12.             result.append(some_work(num1, num2))
  13.            
  14.     for num in nums:
  15.         result.append(num)
  16.            
  17.     return result
RAW Paste Data