def encode_list(list1):
    from itertools import groupby
    
    return [[len(list(group)), key] for key, group in groupby(list1)]
def heap_queue_largest(nums,n):
  import heapq as hq
  
  largest_nums = hq.nlargest(n, nums)
  return largest_nums