Skip to content

Instantly share code, notes, and snippets.

Sink: 0
Sink: 1
Async for loop: 1
Sink: 2
Async for loop: 2
Sink: 3
Async for loop: 3
Sink: 4
Async for loop: 4
Sink: 5
import Foundation
func countPrimes(_ n: Int) -> Int {
var isPrime = [Bool](repeating: false, count: n+1)
var primeCount = 0
if n <= 1 {
return 0
}
var num = 2
let max = Int(sqrt(Double(n)))
func orderFood<T: Server>(server: T, size: Int) {
prepareFood(server: server, size: size)
if !isFoodReady(server: server) {
fatalError("Food is not ready for some reason")
}
}
extension DinnerServer: Server { }
### Keybase proof
I hereby claim:
* I am lvalenta on github.
* I am lvalenta (https://keybase.io/lvalenta) on keybase.
* I have a public key ASAMg2SAFWdseanuRs3-BWzPOZpwAabAnHNC_QuFs8aE3Ao
To claim this, I am signing this object: