/**
 * Merge two lists by creating a nested while loop and using list comprehension.
 *
 * @param list1 First list containing elements.
 * @param list2 Second list containing elements.
 * @return A new merged list with elements from both lists.
 */
fun mergeLists(list1: List<Int>, list2: List<Int>): List<Int> {

    val mergedList = mutableListOf<Int>()

    var i = 0
    while (i < list1.size) {
        var j = 0
        while (j < list2.size) {
            mergedList.add(list1[i] * list2[j])
            j++
        }
        i++
    }

    return mergedList
}
/**
 * Merge two lists by creating a nested while loop and using list comprehension.
 *
 * @param list1 First list containing elements.
 * @param list2 Second list containing elements.
 * @return A new merged list with elements from both lists.
 */
fun mergeLists(list1: List<Int>, list2: List<Int>): List<Int> {
/**
 * Merge two lists by creating a nested while loop and using list comprehension.
 *
 * @param list1 First list containing elements.
 * @param list2 Second list containing elements.
 * @return A new merged list with elements from both lists.
 */
fun mergeLists(list1: List<Int>, list2: List<Int>): List<Int> {

    val mergedList = mutableListOf<Int>()

    var i = 0
    while (i < list1.size) {
        var j = 0
        while (j < list2.size) {
            mergedList.add(list1[i] * list2[j])
            j++
        }
        i++
    }

    return mergedList
}