In Python, does a set count as a buffer?
<p>I am working through Cracking the Coding Interview (4th ed), and one of the questions is as follows:</p>

<blockquote>
  <p>Design an algorithm and write code to remove the duplicate characters in a string
  without using any additional buffer. NOTE: One or two additional variables are fine.
  An extra copy of the array is not.</p>
</blockquote>

<p>I have written the following solution, which satisfies all of the test cases specified by the author:</p>

<pre><code>def remove_duplicate(s):
    return ''.join(sorted(set(s)))

print(remove_duplicate("abcd")) // output "abcd"
print(remove_duplicate("aaaa")) // output "a"
print(remove_duplicate("")) // output ""
print(remove_duplicate("aabb")) // output "ab"
</code></pre>

<p>Does my use of a set in my solution count as the use of an additional buffer, or is my solution adequate? If my solution is not adequate, what would be a better way to go about this?</p>

<p>Thank you very much!</p>