/**
 * Given two lists, create a new list that contains the elements of both lists from the specified start index (inclusive) to the specified end index (exclusive).
 *
 * @param list1 First list.
 * @param list2 Second list.
 * @param start Start index.
 * @param end End index.
 * @return Sliced list containing elements from both input lists.
 *
 * Example:
 * Given list1 = [1, 2, 3, 4, 5] and list2 = [6, 7, 8, 9, 10], and start = 1, and end = 4,
 * the expected output would be [2, 3, 6, 7, 8].
 */
fun createSlicedList(list1: List<Int>, list2: List<Int>, start: Int, end: Int): List<Int> {

    // Combine the two lists
    val combinedList = list1 + list2

    // Slice the combined list
    val slicedList = combinedList.subList(start, end)

    return slicedList
}
/**
 * Given two lists, create a new list that contains the elements of both lists from the specified start index (inclusive) to the specified end index (exclusive).
 *
 * @param list1 First list.
 * @param list2 Second list.
 * @param start Start index.
 * @param end End index.
 * @return Sliced list containing elements from both input lists.
 *
 * Example:
 * Given list1 = [1, 2, 3, 4, 5] and list2 = [6, 7, 8, 9, 10], and start = 1, and end = 4,
 * the expected output would be [2, 3, 6, 7, 8].
 */
fun createSlicedList(list1: List<Int>, list2: List<Int>, start: Int, end: Int): List<Int> {
/**
 * Given two lists, create a new list that contains the elements of both lists from the specified start index (inclusive) to the specified end index (exclusive).
 *
 * @param list1 First list.
 * @param list2 Second list.
 * @param start Start index.
 * @param end End index.
 * @return Sliced list containing elements from both input lists.
 *
 * Example:
 * Given list1 = [1, 2, 3, 4, 5] and list2 = [6, 7, 8, 9, 10], and start = 1, and end = 4,
 * the expected output would be [2, 3, 6, 7, 8].
 */
fun createSlicedList(list1: List<Int>, list2: List<Int>, start: Int, end: Int): List<Int> {

    // Combine the two lists
    val combinedList = list1 + list2

    // Slice the combined list
    val slicedList = combinedList.subList(start, end)

    return slicedList
}