Skip to content

Instantly share code, notes, and snippets.

View cnguy's full-sized avatar
🎮
10k requests/sec only

Chau cnguy

🎮
10k requests/sec only
View GitHub Profile
inputs = [
([9, 4.5, 3, 2, 4, 1, 8, 9.5], 20),
([3, 4.5, 3, 2, 4, 1, 8, 9.5], 20),
([1, 4.5, 3, 8, 4, 1, 8, 9.5], 20),
([2, 4.5, 3, 2, 4, 1, 8, 0], 1),
([4, 4.5, 7, 2, 1], 6.5)
]
"""
The goal of this problem is that given a list of unsorted weights,

Advanced Functional Programming with Scala - Notes

Copyright © 2017 Fantasyland Institute of Learning. All rights reserved.

1. Mastering Functions

A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.

val square : Int => Int = x => x * x

Advanced Functional Programming with Scala - Notes

Copyright © 2017 Fantasyland Institute of Learning. All rights reserved.

1. Mastering Functions

A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.

val square : Int => Int = x => x * x

Advanced Functional Programming with Scala - Notes

Copyright © 2017 Fantasyland Institute of Learning. All rights reserved.

1. Mastering Functions

A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.

val square : Int => Int = x => x * x