Revisiting the Strategy pattern in Kotlin

The Strategy pattern is a useful pattern for encapsulating algorithms, or pieces of algorithms, in self-contained units of computation, and which then enable your code to delegate to those encapsulated strategies when needed. In this section, we'll take a look at how higher-order functions in Kotlin can make the Strategy pattern easier to implement.