daily pastebin goal
24%
SHARE
TWEET

Untitled

a guest Jan 19th, 2019 113 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def map(s: Set, f: Int => Int): Set = (x: Int) =>  {
  2.     var flag : Boolean = false
  3.     for(i <- -bound to bound) {
  4.       if(s(i) && f(i) == x){
  5.         flag = true
  6.       }
  7.     }
  8.     flag
  9.   }
  10.    
  11. (-bound to bound) exists {i => s(i) && f(i) == x}
  12.    
  13. def map(s: Set[Int], f: Int => Int): (Int => Boolean) =
  14.   (x: Int) => {
  15.     (-bound to bound).exists(i => s(i) && f(i) == x)
  16.   }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top