/**
 * Given a list of tuples, modify each tuple by replacing the second element with its square.
 *
 * @param tuplesList A list of tuples containing two elements.
 * @return The modified list of tuples.
 */
fun modifyTuples(tuplesList: MutableList<Pair<String, Int>>): MutableList<Pair<String, Int>> {

    for (i in tuplesList.indices) {
        val (firstElem, secondElem) = tuplesList[i]
        val square = secondElem * secondElem
        val modifiedTuple = Pair(firstElem, square)
        tuplesList[i] = modifiedTuple
    }
    return tuplesList
}

// Example usage
/**
 * Given a list of tuples, modify each tuple by replacing the second element with its square.
 *
 * @param tuplesList A list of tuples containing two elements.
 * @return The modified list of tuples.
 */
fun modifyTuples(tuplesList: MutableList<Pair<String, Int>>): MutableList<Pair<String, Int>> {
/**
 * Given a list of tuples, modify each tuple by replacing the second element with its square.
 *
 * @param tuplesList A list of tuples containing two elements.
 * @return The modified list of tuples.
 */
fun modifyTuples(tuplesList: MutableList<Pair<String, Int>>): MutableList<Pair<String, Int>> {

    for (i in tuplesList.indices) {
        val (firstElem, secondElem) = tuplesList[i]
        val square = secondElem * secondElem
        val modifiedTuple = Pair(firstElem, square)
        tuplesList[i] = modifiedTuple
    }
    return tuplesList
}

// Example usage