Advertisement
Hiteshw11

A Dart program that takes two sets and finds the symmetric difference (elements that are in either

Nov 17th, 2024
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 0.29 KB | Source Code | 0 0
  1. // A Dart program that takes two sets and finds the symmetric difference (elements that are in either of the sets but not in their intersection).
  2.  
  3. void main()
  4. {
  5.   Set<int> a ={1,2,3};
  6.   Set<int> b={2,3,4};
  7.   Set<int> c=a.union(b);
  8.   Set<int> d=a.intersection(b);
  9.   print(c.difference(d));
  10. }
Tags: dart
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement