This file contains hidden or 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
| import java.time.LocalDateTime; | |
| import java.time.ZoneId; | |
| import java.time.ZoneOffset; | |
| import java.util.Date; | |
| import java.util.function.Function; | |
| import java.util.function.UnaryOperator; | |
| public class DateWrapper { | |
| private LocalDateTime localDateTime; |
This file contains hidden or 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
| [ | |
| {"keys": ["alt+`"], "command": "toggle_mozc"} | |
| ] |
This file contains hidden or 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
| package euler.zerosum | |
| import euler.zerosum.Number._ | |
| object Euler0038 { | |
| private val nums = from(1).take(9999) | |
| private val digits = (1 to 9).toList | |
| private val nineDigitNums: Set[String] = digits.permutations.map(_.mkString).toSet |
This file contains hidden or 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
| package euler.zerosum | |
| import scala.io.Source | |
| object Euler0079 { | |
| def main(args: Array[String]) { | |
| val f = Source.fromFile("resources/keylog.txt") | |
| val keylogs = f.getLines.toList | |
| f.close() |
This file contains hidden or 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
| package euler.zerosum | |
| import euler.zerosum.Prime._ | |
| import euler.zerosum.Number._ | |
| import euler.zerosum.Divisors._ | |
| object Euler0046 { | |
| private val oddComposites = from(2).filterNot(n => n % 2 == 0 || primes(1, n).contains(n)) |
This file contains hidden or 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
| package euler.zerosum | |
| import io.Source | |
| object Euler0089 { | |
| def main(args: Array[String]) { | |
| val f = Source.fromFile("resources/roman.txt") | |
| val roman = f.getLines.toList | |
| f.close() |
This file contains hidden or 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
| package euler.zerosum | |
| import euler.zerosum.Prime._ | |
| object Euler0007 { | |
| def main(args: Array[String]) { | |
| println(primes(1, 110000).take(10001).last) | |
| } | |
| } |
This file contains hidden or 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
| package euler.zerosum | |
| import euler.zerosum.Prime._ | |
| import euler.zerosum.Divisors._ | |
| object Euler0035 { | |
| def main(args: Array[String]) { | |
| println(provideCircularPrimes(primes(1, 1000000), Nil).length) | |
| } |
This file contains hidden or 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
| package euler.zerosum | |
| object Euler0065 { | |
| def main(args: Array[String]) { | |
| val a = e.take(100) | |
| val numer = a.init.foldRight(new Rational(a.last, 1))(new Rational(_, 1) + new Rational(1, 1) / _).numer | |
| println(numer.toString.toList.map(_.toInt - 48).sum) | |
| } |
This file contains hidden or 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
| package euler.zerosum | |
| import euler.zerosum.Number._ | |
| object Euler0092 { | |
| def main(args: Array[String]) { | |
| val n = from(0).take(1000) | |
| println( |