/**
 * Given a number line represented as a list of integers in ascending order,
 * insert the given number into the appropriate position in the list.
 * Return the modified number line.
 *
 * @param numberLine list of integers representing the number line
 * @param number integer to be inserted in the number line
 * @return modified number line
 *
 * Example:
 * insertNumber(listOf(0, 2, 4, 6, 8, 10), 5)
 * Output: [0, 2, 4, 5, 6, 8, 10]
 */
fun insertNumber(numberLine: MutableList<Int>, number: Int): List<Int> {

    var index = 0
    while (index < numberLine.size && numberLine[index] < number) {
        index++
    }
    numberLine.add(index, number)
    return numberLine
}
/**
 * Given a number line represented as a list of integers in ascending order,
 * insert the given number into the appropriate position in the list.
 * Return the modified number line.
 *
 * @param numberLine list of integers representing the number line
 * @param number integer to be inserted in the number line
 * @return modified number line
 *
 * Example:
 * insertNumber(listOf(0, 2, 4, 6, 8, 10), 5)
 * Output: [0, 2, 4, 5, 6, 8, 10]
 */
fun insertNumber(numberLine: MutableList<Int>, number: Int): List<Int> {
/**
 * Given a number line represented as a list of integers in ascending order,
 * insert the given number into the appropriate position in the list.
 * Return the modified number line.
 *
 * @param numberLine list of integers representing the number line
 * @param number integer to be inserted in the number line
 * @return modified number line
 *
 * Example:
 * insertNumber(listOf(0, 2, 4, 6, 8, 10), 5)
 * Output: [0, 2, 4, 5, 6, 8, 10]
 */
fun insertNumber(numberLine: MutableList<Int>, number: Int): List<Int> {

    var index = 0
    while (index < numberLine.size && numberLine[index] < number) {
        index++
    }
    numberLine.add(index, number)
    return numberLine
}