Skip to main content
1 of 3
Sp3000
  • 62.3k
  • 13
  • 117
  • 292

><>, 49 bytes

i:1+?v; >~70g:@@?!o 0pl0$\7 ={+@}>:?!^1-@}:70g-0 
> doesn't have strings, only a strange mix of int/char/float, so we have to do a lot of stack shifting. We leave all characters read so far on the stack, and check the current char against every one of them.
[outer loop] i Read a char :1+?v; If it's EOF, halt. Otherwise, go down 70p Store the char at (7, 0) l Push the length of the stack (number of chars to check through). Call this L. 0 Push a 0 (will end up as 0 if unique else positive). Call this U. [inner loop] :?!^ If L is zero, exit the loop and go up. 1- Decrement L @}:70g-0= Check if the char equals the top char on the stack {+@} If so, add 1 to U, else add 0. Rotate the top char to the bottom. [outer loop continued] ~ Pop L 70g: Push the char and a copy @@?!o If U is zero, print the char 

Note that the last part means that sometimes we leave two copies of a char on the stack if U is positive, but that's perfectly okay since we're only concerned about the set of chars read so far.

Sp3000
  • 62.3k
  • 13
  • 117
  • 292