Let’s suppose you have to given a list of integers. For example : val list = listOf(-12, -5, 1, 9, 11) Filter : You have to create a list of positive numbers from above list. To achieve this ,typical code is val result = mutableListOf<Int>()
for (num in list) {…