/**
 * Given a list of purchases made by a fashion designer, calculate the average price of all the items.
 *
 * Example:
 * purchases = listOf(Pair("dress", 150), Pair("shirt", 100), Pair("pants", 80))
 * calculateAverage(purchases) => 110
 *
 * @param purchases A list of pairs representing the name of the item and its price.
 * @return The average price of all the items.
 */
fun calculateAverage(purchases: List<Pair<String, Int>>): Double {

    var totalPrice = 0
    var count = 0

    for ((_, price) in purchases) {
        totalPrice += price
        count++
    }

    val averagePrice = totalPrice.toDouble() / count
    return averagePrice
}
/**
 * Given a list of purchases made by a fashion designer, calculate the average price of all the items.
 *
 * Example:
 * purchases = listOf(Pair("dress", 150), Pair("shirt", 100), Pair("pants", 80))
 * calculateAverage(purchases) => 110
 *
 * @param purchases A list of pairs representing the name of the item and its price.
 * @return The average price of all the items.
 */
fun calculateAverage(purchases: List<Pair<String, Int>>): Double {
/**
 * Given a list of purchases made by a fashion designer, calculate the average price of all the items.
 *
 * Example:
 * purchases = listOf(Pair("dress", 150), Pair("shirt", 100), Pair("pants", 80))
 * calculateAverage(purchases) => 110
 *
 * @param purchases A list of pairs representing the name of the item and its price.
 * @return The average price of all the items.
 */
fun calculateAverage(purchases: List<Pair<String, Int>>): Double {

    var totalPrice = 0
    var count = 0

    for ((_, price) in purchases) {
        totalPrice += price
        count++
    }

    val averagePrice = totalPrice.toDouble() / count
    return averagePrice
}