union

Returns a set containing all distinct elements from both collections.

infix fun <T> Array<out T>.union(other: Iterable<T>): Set<T>(source)
fun main() {
    val numbers = arrayOf(1, 2, 3)
    val moreNumbers = listOf(3, 4, 5)

    val unionSet: Set<Int> = numbers union moreNumbers

    println(unionSet) // Output: [1, 2, 3, 4, 5]
}

Source