## My favorite examples of functional programming in the language Kotlin

One of the great features of Kotlin is that it supports functional programming. Let's look at and discuss some simple but expressive functions written in Kotlin.

Superset (Boolean)

If you studied algebra at a university, you can recall what a superset is. For any set, its superset is the set of all its subsets, including the original set itself and the empty set. For example, if we have the following set:

{??3}

Then his superset:

{{}, {1}, {2}, {3}, {?2}, {?3}, {?3}, {??3}}

In algebra such a function is very useful. How do we implement it?

If you want to challenge yourself, stop reading ...

Superset (Boolean)

If you studied algebra at a university, you can recall what a superset is. For any set, its superset is the set of all its subsets, including the original set itself and the empty set. For example, if we have the following set:

{??3}

Then his superset:

{{}, {1}, {2}, {3}, {?2}, {?3}, {?3}, {??3}}

In algebra such a function is very useful. How do we implement it?

If you want to challenge yourself, stop reading ...