-
-
Save rsp/f78d80a70f46bbc0fbc57576807775e1 to your computer and use it in GitHub Desktop.
inFullMobile Language Wars: Round 1 - Swift Solution 1 - by @mikchmie-ifm - See: https://gist.github.com/rsp/d8bdbafa09f24f99eebc8ed60fe205c8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
func f(_ foo: @escaping (@escaping (Int) -> Int) -> (Int) -> Int) -> (@escaping (Int) -> Int) -> (Int) -> Int { | |
return { op in | |
return { num in | |
let times = foo({ x in x + 1 })(0) - 1 | |
return (0..<times).reduce(num, { result, _ in op(result) }) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment