Advertisement
om_gan

c# strings

Mar 25th, 2012
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. x = {1,2,3,4,5,6}
  2. y = {3,4}
  3. z = {6,7}
  4.  
  5. var x = new HashSet<int>(Enumerable.Range(1,6)); // [1,2,3,4,5,6]
  6. var y = Enumerable.Range(1,3); // [1,2,3]
  7. var z = Enumerable.Range(6,2); // [6,7]
  8. x.IsSupersetOf(y); // true
  9. x.IsSupersetOf(z); // false
  10.  
  11. if(y[0] <= x[x.length-1])
  12. //binary search in array x for y[y.length-1]
  13. //if that is true u can say that y in x else false.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement