range
Return a list from i (inclusive) to j (exclusive).
i
j
range(1, 5) //-> [1, 2, 3, 4]
Source Codepublic fun range(i: Int, j: Int): List<Int> { let items: List<Int> = [] while i < j { items = items.append(i) i += 1 } items }
public fun range(i: Int, j: Int): List<Int> { let items: List<Int> = [] while i < j { items = items.append(i) i += 1 } items }