code: def max_el_subarrays(arr, k):
      n = len(arr)
      if n == 0:
          return -1
  
      deq = deque()
      result = []
  
      # starting sliding window
      for i in range(min(k, n)):
          # start from the end and remove all previous indicies
          # which have smaller values than the current one
          # using this logic, we're sure that there is no smaller element (in the previous added indicies, the whole deque) than the last added
          while (deq) and (arr[i] >= arr[deq[-1]]):
              deq.pop()
          # add the current index on back/right
          deq.append(i)
  
      # add the biggest element in the result array
      # the biggest element is always located in front/left
      result.append(arr[deq[0]])
  
      # move element by element (slide the window)
      for i in range(k, n):
          # remove the front index if it's outside the window
          if (deq) and (deq[0] == i - k):
              deq.popleft()
  
          # use the same logic as before, remove from back/right and add to front/left
          while (deq) and (arr[i] >= arr[deq[-1]]):
              deq.pop()
  
          deq.append(i)
          result.append(arr[deq[0]])
  
      return result
  
label_desc: Use image node_id 1 for calling a global function with example usage: max_el_subarrays(arr, k) and returns: result, unknown