Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import Foundation
func listSum(n: Int, tot: Int) ->[Int] {
return n == 1 ? [tot] :
{[$0, tot - $0] + listSum(n - 1, tot - $0)} (Int(arc4random_uniform(UInt32(tot - n))))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.