Skip to main content
deleted 8 characters in body
Source Link
rm -rf
  • 89.3k
  • 21
  • 296
  • 478

If you don't care about the original sorting order (or if you want it sorted), use Union:

Union@{a, 1, 5, 3, 5, x^2, x^2}
(* {1, 3, 5, a, x^2} *)

{1, 3, 5, a, x^2}

If you don't care about the original sorting order:

Union@{a, 1, 5, 3, 5, x^2, x^2}

{1, 3, 5, a, x^2}

If you don't care about the original order (or if you want it sorted), use Union:

Union@{a, 1, 5, 3, 5, x^2, x^2}
(* {1, 3, 5, a, x^2} *)
added 23 characters in body
Source Link
István Zachar
  • 47.2k
  • 20
  • 145
  • 293

If you don't care about the original sortingsorting order:

Union@{a, 1, 5, 3, 5, x^2, x^2}

{1, 3, 5, a, x^2}

If you don't care about the original sorting:

Union@{a, 1, 5, 3, 5, x^2, x^2}

{1, 3, 5, a, x^2}

If you don't care about the original sorting order:

Union@{a, 1, 5, 3, 5, x^2, x^2}

{1, 3, 5, a, x^2}

Source Link
István Zachar
  • 47.2k
  • 20
  • 145
  • 293

If you don't care about the original sorting:

Union@{a, 1, 5, 3, 5, x^2, x^2}

{1, 3, 5, a, x^2}