/**
 * Given a tuple, modify the elements within a given range using slicing.
 *
 * @param tup The original tuple.
 * @param start_index The starting index (inclusive) of the range.
 * @param end_index The ending index (exclusive) of the range.
 * @return The modified tuple after replacing the elements within the specified range.
 *
 * Example:
 * Input:
 * tup = listOf('a', 'b', 'c', 'd', 'e')
 * start_index = 1
 * end_index = 4
 *
 * Output:
 * listOf('a', 'X', 'X', 'X', 'e')
 */
fun modifyTupleElements(tup: List<Char>, start_index: Int, end_index: Int): List<Char> {

    return tup.subList(0, start_index) + List(end_index - start_index) { 'X' } + tup.subList(end_index, tup.size)
}
/**
 * Given a tuple, modify the elements within a given range using slicing.
 *
 * @param tup The original tuple.
 * @param start_index The starting index (inclusive) of the range.
 * @param end_index The ending index (exclusive) of the range.
 * @return The modified tuple after replacing the elements within the specified range.
 *
 * Example:
 * Input:
 * tup = listOf('a', 'b', 'c', 'd', 'e')
 * start_index = 1
 * end_index = 4
 *
 * Output:
 * listOf('a', 'X', 'X', 'X', 'e')
 */
fun modifyTupleElements(tup: List<Char>, start_index: Int, end_index: Int): List<Char> {
/**
 * Given a tuple, modify the elements within a given range using slicing.
 *
 * @param tup The original tuple.
 * @param start_index The starting index (inclusive) of the range.
 * @param end_index The ending index (exclusive) of the range.
 * @return The modified tuple after replacing the elements within the specified range.
 *
 * Example:
 * Input:
 * tup = listOf('a', 'b', 'c', 'd', 'e')
 * start_index = 1
 * end_index = 4
 *
 * Output:
 * listOf('a', 'X', 'X', 'X', 'e')
 */
fun modifyTupleElements(tup: List<Char>, start_index: Int, end_index: Int): List<Char> {

    return tup.subList(0, start_index) + List(end_index - start_index) { 'X' } + tup.subList(end_index, tup.size)
}