/**
 * This function takes a matrix and replaces a specific range of elements from the given row and column coordinates
 * with a replacement value. It then returns the modified matrix.
 *
 * @param matrix a 2-dimensional list representing the matrix
 * @param row an integer specifying the starting row index
 * @param column an integer specifying the starting column index
 * @param start an integer specifying the starting value (inclusive)
 * @param end an integer specifying the ending value (exclusive)
 * @param replacement the value to replace the elements within the given range
 * @return the modified matrix with replaced elements
 */
fun replaceElements(matrix: Array<IntArray>, row: Int, column: Int, start: Int, end: Int, replacement: Int): Array<IntArray> {

    for (i in row until matrix.size) {
        for (j in column until matrix[i].size) {
            if (matrix[i][j] >= start && matrix[i][j] < end) {  // Check if value is in the specified range
                matrix[i][j] = replacement
            }
        }
    }
    return matrix
}
/**
 * This function takes a matrix and replaces a specific range of elements from the given row and column coordinates
 * with a replacement value. It then returns the modified matrix.
 *
 * @param matrix a 2-dimensional list representing the matrix
 * @param row an integer specifying the starting row index
 * @param column an integer specifying the starting column index
 * @param start an integer specifying the starting value (inclusive)
 * @param end an integer specifying the ending value (exclusive)
 * @param replacement the value to replace the elements within the given range
 * @return the modified matrix with replaced elements
 */
fun replaceElements(matrix: Array<IntArray>, row: Int, column: Int, start: Int, end: Int, replacement: Int): Array<IntArray> {
/**
 * This function takes a matrix and replaces a specific range of elements from the given row and column coordinates
 * with a replacement value. It then returns the modified matrix.
 *
 * @param matrix a 2-dimensional list representing the matrix
 * @param row an integer specifying the starting row index
 * @param column an integer specifying the starting column index
 * @param start an integer specifying the starting value (inclusive)
 * @param end an integer specifying the ending value (exclusive)
 * @param replacement the value to replace the elements within the given range
 * @return the modified matrix with replaced elements
 */
fun replaceElements(matrix: Array<IntArray>, row: Int, column: Int, start: Int, end: Int, replacement: Int): Array<IntArray> {

    for (i in row until matrix.size) {
        for (j in column until matrix[i].size) {
            if (matrix[i][j] >= start && matrix[i][j] < end) {  // Check if value is in the specified range
                matrix[i][j] = replacement
            }
        }
    }
    return matrix
}