/**
 * Given a list 'data' and an integer 'shift', this function performs a bitwise right shift
 * on the elements of the list and returns the sliced sub-list from the original list.
 *
 * @param data The input list.
 * @param shift The number of positions to shift the bits to the right.
 * @return The resulting sub-list after performing the bit shift.
 *
 * Example:
 * val data = listOf(4, 5, 6, 7)
 * val shift = 2
 * shiftAndSlice(data, shift) -> listOf(4, 5)
 */
fun shiftAndSlice(data: List<Int>, shift: Int): List<Int> {

    val result = mutableListOf<Int>()
    for (num in data) {
        result.add(num shr shift) // Perform right shift on each element and add to the result list
    }
    return result.subList(0, data.size / 2) // Slice the sub-list from the original list
}
/**
 * Given a list 'data' and an integer 'shift', this function performs a bitwise right shift
 * on the elements of the list and returns the sliced sub-list from the original list.
 *
 * @param data The input list.
 * @param shift The number of positions to shift the bits to the right.
 * @return The resulting sub-list after performing the bit shift.
 *
 * Example:
 * val data = listOf(4, 5, 6, 7)
 * val shift = 2
 * shiftAndSlice(data, shift) -> listOf(4, 5)
 */
fun shiftAndSlice(data: List<Int>, shift: Int): List<Int> {
/**
 * Given a list 'data' and an integer 'shift', this function performs a bitwise right shift
 * on the elements of the list and returns the sliced sub-list from the original list.
 *
 * @param data The input list.
 * @param shift The number of positions to shift the bits to the right.
 * @return The resulting sub-list after performing the bit shift.
 *
 * Example:
 * val data = listOf(4, 5, 6, 7)
 * val shift = 2
 * shiftAndSlice(data, shift) -> listOf(4, 5)
 */
fun shiftAndSlice(data: List<Int>, shift: Int): List<Int> {

    val result = mutableListOf<Int>()
    for (num in data) {
        result.add(num shr shift) // Perform right shift on each element and add to the result list
    }
    return result.subList(0, data.size / 2) // Slice the sub-list from the original list
}