Logo

Programming-Idioms

History of Idiom 118 > diff from v69 to v70

Edit summary for version 70 by programming-idioms.org:
[Ruby] Added Doc URL

Version 69

2022-08-23, 22:49:28

Version 70

2022-09-05, 12:35:38

Idiom #118 List to set

Create the set y from the list x.
x may contain duplicates. y is unordered and has no repeated values.

Turning the list [a,b,c,b] into the set {c,a,b}

Idiom #118 List to set

Create the set y from the list x.
x may contain duplicates. y is unordered and has no repeated values.

Turning the list [a,b,c,b] into the set {c,a,b}
Variables
y,x
Variables
y,x
Imports
require 'set'
Imports
require 'set'
Code
y = x.to_set
Code
y = x.to_set
Doc URL
https://replit.com/@ProgIdioms/PrudentChartreuseAngle#main.rb