Data update
This commit is contained in:
parent
4bb20c9b71
commit
cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions
20
Task/Set/Gleam/set.gleam
Normal file
20
Task/Set/Gleam/set.gleam
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
import gleam/set
|
||||
|
||||
pub fn main() {
|
||||
let s = set.new()
|
||||
let sa = set.insert(s, "a")
|
||||
let sab = set.from_list(["a", "b"])
|
||||
echo set.contains(sa, "a")
|
||||
let union = set.union(sa, sab)
|
||||
let union_list = set.to_list(union)
|
||||
echo union_list
|
||||
let intersection = set.intersection(sa, sab)
|
||||
let intersection_list = set.to_list(intersection)
|
||||
echo intersection_list
|
||||
let subtract = set.difference(sab, sa)
|
||||
let subtract_list = set.to_list(subtract)
|
||||
echo subtract_list
|
||||
let is_subset = set.is_subset(sa, sab)
|
||||
echo is_subset
|
||||
echo sa == sab
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue