/**
 * This function copies the specified columns from the given dataset.
 *
 * @param dataset The dataset containing multiple rows and columns.
 * @param columns The list of column indices to be copied.
 * @return The copied data from the specified columns.
 */
fun copyData(dataset: List<List<Any>>, columns: List<Int>): List<List<Any>> {

    val copiedData = mutableListOf<List<Any>>()  // Initialize an empty list to store copied data
    for (row in dataset) {  // Iterate over each row in the dataset
        val copiedRow = mutableListOf<Any>()  // Initialize an empty list to store each copied row
        for (column in columns) {  // Iterate over each column index
            copiedRow.add(row[column])  // Append the element from the specified column index to copiedRow
        }
        copiedData.add(copiedRow)  // Append the copiedRow to the copiedData list
    }
    return copiedData
}

// Let's assume a dataset containing information about building materials
val buildingMaterials = listOf(
    listOf("Cement", "Bricks", "Steel", "Sand", "Wood"),
    listOf(2, 10, 5, 20, 50),
    listOf(4, 15, 7, 30, 75)
)
/**
 * This function copies the specified columns from the given dataset.
 *
 * @param dataset The dataset containing multiple rows and columns.
 * @param columns The list of column indices to be copied.
 * @return The copied data from the specified columns.
 */
fun copyData(dataset: List<List<Any>>, columns: List<Int>): List<List<Any>> {
/**
 * This function copies the specified columns from the given dataset.
 *
 * @param dataset The dataset containing multiple rows and columns.
 * @param columns The list of column indices to be copied.
 * @return The copied data from the specified columns.
 */
fun copyData(dataset: List<List<Any>>, columns: List<Int>): List<List<Any>> {

    val copiedData = mutableListOf<List<Any>>()  // Initialize an empty list to store copied data
    for (row in dataset) {  // Iterate over each row in the dataset
        val copiedRow = mutableListOf<Any>()  // Initialize an empty list to store each copied row
        for (column in columns) {  // Iterate over each column index
            copiedRow.add(row[column])  // Append the element from the specified column index to copiedRow
        }
        copiedData.add(copiedRow)  // Append the copiedRow to the copiedData list
    }
    return copiedData
}

// Let's assume a dataset containing information about building materials
val buildingMaterials = listOf(
    listOf("Cement", "Bricks", "Steel", "Sand", "Wood"),
    listOf(2, 10, 5, 20, 50),
    listOf(4, 15, 7, 30, 75)
)