/**
 * This function modifies elements in a list by assigning a value
 * to the element at a specified index. It uses short-circuiting to
 * avoid indexing errors and modifies the list in-place.
 *
 * @param elements A list of elements.
 * @param index The index of the element to be modified.
 * @param value The value to assign to the element.
 */
fun modifyList(elements: MutableList<Int>, index: Int, value: Int) {

    if (index in elements.indices) {
        elements[index] = value
    }
}
/**
 * This function modifies elements in a list by assigning a value
 * to the element at a specified index. It uses short-circuiting to
 * avoid indexing errors and modifies the list in-place.
 *
 * @param elements A list of elements.
 * @param index The index of the element to be modified.
 * @param value The value to assign to the element.
 */
fun modifyList(elements: MutableList<Int>, index: Int, value: Int) {
/**
 * This function modifies elements in a list by assigning a value
 * to the element at a specified index. It uses short-circuiting to
 * avoid indexing errors and modifies the list in-place.
 *
 * @param elements A list of elements.
 * @param index The index of the element to be modified.
 * @param value The value to assign to the element.
 */
fun modifyList(elements: MutableList<Int>, index: Int, value: Int) {

    if (index in elements.indices) {
        elements[index] = value
    }
}