Skip to content

Instantly share code, notes, and snippets.

@mmar
Last active December 28, 2020 22:32
Show Gist options
  • Save mmar/7f8c5111f491f8e45d5caba151eef492 to your computer and use it in GitHub Desktop.
Save mmar/7f8c5111f491f8e45d5caba151eef492 to your computer and use it in GitHub Desktop.
Pascal's Triangle (Swift)
let pascalsTriangle = sequence(first: [1]) {
zip([0] + $0, $0 + [0]).map(+)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment