Set: Difference between revisions

593 bytes added ,  2 years ago
add BQN
(Added solution for Action!)
(add BQN)
Line 854:
Set A is not equal to set B
</pre>
 
=={{header|BQN}}==
 
BQN can use lists with only unique elements to represent sets. The following implement all the basic set relations.
 
<lang bqn>Union ← ⍷∾
Inter ← ∊/⊣
Diff ← ¬∘∊/⊣
Subset ← ∧´∊
Eq ← ≡○∧
CreateSet ← ⍷
 
•Show 2‿4‿6‿8 Union 2‿3‿5‿7
•Show 2‿4‿6‿8 Inter 2‿3‿5‿7
•Show 2‿4‿6‿8 Diff 2‿3‿5‿7
•Show 2‿4‿6‿8 Subset 2‿3‿5‿7
•Show 2‿4‿6‿8 Eq 2‿3‿5‿7
•Show CreateSet 2‿2‿3‿5‿7‿2</lang><lang>⟨ 2 4 6 8 3 5 7 ⟩
⟨ 2 ⟩
⟨ 4 6 8 ⟩
0
0
⟨ 2 3 5 7 ⟩</lang>
 
=={{header|C}}==
236

edits