/**
 * This function takes a matrix and modifies an element at a given row and column with a provided value.
 *
 * @param matrix The matrix to be modified.
 * @param row The row index of the element to be modified.
 * @param col The column index of the element to be modified.
 * @param value The new value to be assigned to the element.
 * @return The modified matrix.
 */
fun modifyListElement(matrix: List<MutableList<Int>>, row: Int, col: Int, value: Int): List<MutableList<Int>> {

    if (row < 0 || row >= matrix.size || col < 0 || col >= matrix[0].size) {
        return matrix
    }

    matrix[row][col] = value
    return matrix
}
/**
 * This function takes a matrix and modifies an element at a given row and column with a provided value.
 *
 * @param matrix The matrix to be modified.
 * @param row The row index of the element to be modified.
 * @param col The column index of the element to be modified.
 * @param value The new value to be assigned to the element.
 * @return The modified matrix.
 */
fun modifyListElement(matrix: List<MutableList<Int>>, row: Int, col: Int, value: Int): List<MutableList<Int>> {
/**
 * This function takes a matrix and modifies an element at a given row and column with a provided value.
 *
 * @param matrix The matrix to be modified.
 * @param row The row index of the element to be modified.
 * @param col The column index of the element to be modified.
 * @param value The new value to be assigned to the element.
 * @return The modified matrix.
 */
fun modifyListElement(matrix: List<MutableList<Int>>, row: Int, col: Int, value: Int): List<MutableList<Int>> {

    if (row < 0 || row >= matrix.size || col < 0 || col >= matrix[0].size) {
        return matrix
    }

    matrix[row][col] = value
    return matrix
}