Skip to content

Instantly share code, notes, and snippets.

@windmaomao
Last active September 18, 2020 17:36
Show Gist options
  • Save windmaomao/a1982040e3ef40e93313013fb6853bca to your computer and use it in GitHub Desktop.
Save windmaomao/a1982040e3ef40e93313013fb6853bca to your computer and use it in GitHub Desktop.
Day 1: Not Quite Lisp, Part 2
// Day 1: Not Quite Lisp, Part 2
fun part2(ops: List<Int>): Int = ops.asSequence()
.scan(0) { acc, v -> acc + v }
.indexOf(-1)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment