/**
 * This function takes a list and an integer 'n' as input. It copies the list and shifts the elements in the copied list
 * to the left by 'n' positions using the left shift operator. It then returns the resulting shifted list.
 *
 * @param lst A list containing elements to be shifted.
 * @param n An integer indicating the number of positions to shift the elements.
 * @return A new list with the elements shifted to the left by 'n' positions.
 *
 * Example:
 * copyListAndShift(listOf(1, 2, 3, 4, 5), 2) => [3, 4, 5, 1, 2]
 */
fun copyListAndShift(lst: List<Int>, n: Int): List<Int> {

    // Copy the original list to avoid modifying the original
    val shiftedList = lst.toMutableList()

    // Apply n left shifts to the copied list
    shiftedList.addAll(shiftedList.subList(0, n))
    shiftedList.removeAll(shiftedList.subList(0, n))

    return shiftedList
}
/**
 * This function takes a list and an integer 'n' as input. It copies the list and shifts the elements in the copied list
 * to the left by 'n' positions using the left shift operator. It then returns the resulting shifted list.
 *
 * @param lst A list containing elements to be shifted.
 * @param n An integer indicating the number of positions to shift the elements.
 * @return A new list with the elements shifted to the left by 'n' positions.
 *
 * Example:
 * copyListAndShift(listOf(1, 2, 3, 4, 5), 2) => [3, 4, 5, 1, 2]
 */
fun copyListAndShift(lst: List<Int>, n: Int): List<Int> {
/**
 * This function takes a list and an integer 'n' as input. It copies the list and shifts the elements in the copied list
 * to the left by 'n' positions using the left shift operator. It then returns the resulting shifted list.
 *
 * @param lst A list containing elements to be shifted.
 * @param n An integer indicating the number of positions to shift the elements.
 * @return A new list with the elements shifted to the left by 'n' positions.
 *
 * Example:
 * copyListAndShift(listOf(1, 2, 3, 4, 5), 2) => [3, 4, 5, 1, 2]
 */
fun copyListAndShift(lst: List<Int>, n: Int): List<Int> {

    // Copy the original list to avoid modifying the original
    val shiftedList = lst.toMutableList()

    // Apply n left shifts to the copied list
    shiftedList.addAll(shiftedList.subList(0, n))
    shiftedList.removeAll(shiftedList.subList(0, n))

    return shiftedList
}