Last active
September 18, 2020 17:36
-
-
Save windmaomao/a1982040e3ef40e93313013fb6853bca to your computer and use it in GitHub Desktop.
Day 1: Not Quite Lisp, Part 2
This file contains 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
// 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