/**
 * Given a list of integers, apply left shift operator to each element by n bits
 * and return a new list containing the shifted values. Use range function to iterate
 * through the list.
 *
 * @param lst A list of integers.
 * @param n An integer representing the number of bits to shift the elements.
 * @return A new list with elements shifted left by n bits.
 *
 * Example:
 * shiftAndRange(listOf(1, 2, 3, 4), 2) => [4, 8, 12, 16]
 */
fun shiftAndRange(lst: List<Int>, n: Int): List<Int> {

    val shiftedList = mutableListOf<Int>()

    for (num in lst.indices) {
        val shiftedNum = lst[num] shl n
        shiftedList.add(shiftedNum)
    }

    return shiftedList
}
/**
 * Given a list of integers, apply left shift operator to each element by n bits
 * and return a new list containing the shifted values. Use range function to iterate
 * through the list.
 *
 * @param lst A list of integers.
 * @param n An integer representing the number of bits to shift the elements.
 * @return A new list with elements shifted left by n bits.
 *
 * Example:
 * shiftAndRange(listOf(1, 2, 3, 4), 2) => [4, 8, 12, 16]
 */
fun shiftAndRange(lst: List<Int>, n: Int): List<Int> {
/**
 * Given a list of integers, apply left shift operator to each element by n bits
 * and return a new list containing the shifted values. Use range function to iterate
 * through the list.
 *
 * @param lst A list of integers.
 * @param n An integer representing the number of bits to shift the elements.
 * @return A new list with elements shifted left by n bits.
 *
 * Example:
 * shiftAndRange(listOf(1, 2, 3, 4), 2) => [4, 8, 12, 16]
 */
fun shiftAndRange(lst: List<Int>, n: Int): List<Int> {

    val shiftedList = mutableListOf<Int>()

    for (num in lst.indices) {
        val shiftedNum = lst[num] shl n
        shiftedList.add(shiftedNum)
    }

    return shiftedList
}