Giter Club home page Giter Club logo

euler's Introduction

2 when(x) expression

5 find prime factors

8 char.toInt, again in 16

10 prime numbers

11 .run { }, by lazy delegates, IntArray() { } builder, 2d array, wanted to reuse a habit from scala to flatMap(Option) but learned to love filterNotNull

12 find divisors of a number

14 good things to know about comparing IntArray

15 overflowed a long! factorial, P(n,k) C(n,k).

16 number -> string -> List -> List: char.toInt() doesn't do what you want

17 build an arrayList with .apply { }

18 stringTo2dArray(), companion object for 67

19 enum classes, you can't put them in the Euler object and import them

20 sum of digits again, now reusable

21 find divisors, so reuse #12, gotcha using IntArray(n) { lambda } constructor

22 reading a file, char[] alphabet, sliceArray(0..5).size == 6, List<Int?> to List via filterNotNull()

23 "naked" when expression

24 lexicographic permutations

26 substringAfter behavior .run {} vs .apply {} Collections.binarySearch data structures suffix tree trie

27 first-order functions

33 Rational class extension function times operator overloading fold companion object

35 Progression.filter ex: (0..100).filter{ it.isDouble }

36 same as 35, plus Integer.toString(x, 2) to get x in base2

37 rewrote Prime.isPrime

39 object subclass override contains

47 rewrote Prime let private constuctor companion factory

48 substring(IntRange)

67 wanted to read the file by name in classpath, this was the easiest way

euler's People

Contributors

chickenbane avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.