/**
 * This function takes a list of integers, the number of left shifts to perform, the number of right shifts to perform,
 * and the index to retrieve a value from the shifted list. It then calculates the shifted list and returns the value
 * at the specified index.
 *
 * @param data List of integers
 * @param shiftLeft Number of left shifts to perform
 * @param shiftRight Number of right shifts to perform
 * @param index Index to retrieve a value from the shifted list
 * @return Value at the specified index in the shifted list
 */
fun calculateShiftedIndex(data: MutableList<Int>, shiftLeft: Int, shiftRight: Int, index: Int): Int {

    // Shift the list to the left
    repeat(shiftLeft) {
        data.add(data.removeAt(0))
    }

    // Shift the list to the right
    repeat(shiftRight) {
        data.add(0, data.removeAt(data.size - 1))
    }

    // Return the value at the specified index
    return data[index]
}
/**
 * This function takes a list of integers, the number of left shifts to perform, the number of right shifts to perform,
 * and the index to retrieve a value from the shifted list. It then calculates the shifted list and returns the value
 * at the specified index.
 *
 * @param data List of integers
 * @param shiftLeft Number of left shifts to perform
 * @param shiftRight Number of right shifts to perform
 * @param index Index to retrieve a value from the shifted list
 * @return Value at the specified index in the shifted list
 */
fun calculateShiftedIndex(data: MutableList<Int>, shiftLeft: Int, shiftRight: Int, index: Int): Int {
/**
 * This function takes a list of integers, the number of left shifts to perform, the number of right shifts to perform,
 * and the index to retrieve a value from the shifted list. It then calculates the shifted list and returns the value
 * at the specified index.
 *
 * @param data List of integers
 * @param shiftLeft Number of left shifts to perform
 * @param shiftRight Number of right shifts to perform
 * @param index Index to retrieve a value from the shifted list
 * @return Value at the specified index in the shifted list
 */
fun calculateShiftedIndex(data: MutableList<Int>, shiftLeft: Int, shiftRight: Int, index: Int): Int {

    // Shift the list to the left
    repeat(shiftLeft) {
        data.add(data.removeAt(0))
    }

    // Shift the list to the right
    repeat(shiftRight) {
        data.add(0, data.removeAt(data.size - 1))
    }

    // Return the value at the specified index
    return data[index]
}