       iex> List.duplicate([1, 2], 2)
       [[1,2],[1,2]]
   """
+  @spec duplicate(elem, non_neg_integer) :: [elem] when is_var(elem)
   def duplicate(elem, n) do
     :lists.duplicate(n, elem)
   end

      [a: 5, b: 3, c: 1]

  """
  def keysort(list, position) do
    :lists.keysort(position + 1, list)
  end

  ## Examples

      iex> List.keydelete([a: 1, b: 2], :a, 0)
      [b: 2]

      iex> List.keydelete([a: 1, b: 2], 2, 1)
      [a: 1]

      iex> List.keydelete([a: 1, b: 2], :c, 0)
      [a: 1, b: 2]

  """
  @spec keydelete([tuple], any, non_neg_integer) :: [tuple]
  def keydelete(list, key, position) do
    :lists.keydelete(key, position + 1, list)
  end
