Complete the code to create a sequence from a list.
val numbers = listOf(1, 2, 3, 4, 5) val seq = numbers.[1]()
The asSequence() function converts a collection into a sequence.
Complete the code to create a sequence of numbers starting from 1.
val seq = [1](1) { it + 1 }
The generateSequence() function creates a sequence by generating values starting from the initial value.
Fix the error in the code to create a sequence from given elements.
val seq = [1](1, 2, 3, 4, 5)
The sequenceOf() function creates a sequence from the given elements.
Fill both blanks to create a sequence from a list and filter even numbers.
val numbers = listOf(1, 2, 3, 4, 5) val evenSeq = numbers.[1]().filter { it [2] 2 == 0 }
Use asSequence() to convert the list, then filter numbers where the remainder when divided by 2 is zero.
Fill all three blanks to create a sequence of squares of numbers from 1 to 5, filtering those greater than 10.
val seq = (1..5).[1]().map { it [2] it }.filter { it [3] 10 }
Convert the range to a sequence, map each number to its square using '*', then filter numbers greater than 10.