Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def map(s: Set, f: Int => Int): Set = (x: Int) => {
- var flag : Boolean = false
- for(i <- -bound to bound) {
- if(s(i) && f(i) == x){
- flag = true
- }
- }
- flag
- }
- (-bound to bound) exists {i => s(i) && f(i) == x}
- def map(s: Set[Int], f: Int => Int): (Int => Boolean) =
- (x: Int) => {
- (-bound to bound).exists(i => s(i) && f(i) == x)
- }
Add Comment
Please, Sign In to add comment