/**
 * This recipe takes in a tuple containing nested tuples. Each nested tuple represents a shift operation.
 * The function performs left shift and right shift operations on the given tuples and returns the result.
 *
 * @param operatorTup A tuple containing nested tuples representing shift operations
 * @return A tuple containing the result of left shift and right shift operations on the given tuples
 */
fun chefCode(operatorTup: List<Pair<String, Int>>): List<Int> {

    var resultTup = emptyList<Int>()
    for (shiftTup in operatorTup) {
        val shiftType = shiftTup.first
        val value = shiftTup.second

        resultTup = when (shiftType) {
            "LEFT" -> resultTup + (resultTup.last() shl value)
            "RIGHT" -> resultTup + (resultTup.last() shr value)
            else -> resultTup
        }
    }
    return resultTup
}

// Example usage
/**
 * This recipe takes in a tuple containing nested tuples. Each nested tuple represents a shift operation.
 * The function performs left shift and right shift operations on the given tuples and returns the result.
 *
 * @param operatorTup A tuple containing nested tuples representing shift operations
 * @return A tuple containing the result of left shift and right shift operations on the given tuples
 */
fun chefCode(operatorTup: List<Pair<String, Int>>): List<Int> {
/**
 * This recipe takes in a tuple containing nested tuples. Each nested tuple represents a shift operation.
 * The function performs left shift and right shift operations on the given tuples and returns the result.
 *
 * @param operatorTup A tuple containing nested tuples representing shift operations
 * @return A tuple containing the result of left shift and right shift operations on the given tuples
 */
fun chefCode(operatorTup: List<Pair<String, Int>>): List<Int> {

    var resultTup = emptyList<Int>()
    for (shiftTup in operatorTup) {
        val shiftType = shiftTup.first
        val value = shiftTup.second

        resultTup = when (shiftType) {
            "LEFT" -> resultTup + (resultTup.last() shl value)
            "RIGHT" -> resultTup + (resultTup.last() shr value)
            else -> resultTup
        }
    }
    return resultTup
}

// Example usage