/**
 * Given a dictionary of wood sizes, find the smallest and largest size.
 */
fun carpenterWork(woodSizes: Map<Pair<Int, Int>, String>): Pair<Pair<Int, Int>, Pair<Int, Int>> {

    var smallest: Pair<Int, Int>? = null
    var largest: Pair<Int, Int>? = null

    for ((size, _) in woodSizes) {
        val (width, height) = size

        if (smallest == null || width < smallest.first) {
            smallest = Pair(width, height)
        }

        if (largest == null || width > largest.first) {
            largest = Pair(width, height)
        }
    }

    return Pair(smallest!!, largest!!)
}
/**
 * Given a dictionary of wood sizes, find the smallest and largest size.
 */
fun carpenterWork(woodSizes: Map<Pair<Int, Int>, String>): Pair<Pair<Int, Int>, Pair<Int, Int>> {
/**
 * Given a dictionary of wood sizes, find the smallest and largest size.
 */
fun carpenterWork(woodSizes: Map<Pair<Int, Int>, String>): Pair<Pair<Int, Int>, Pair<Int, Int>> {

    var smallest: Pair<Int, Int>? = null
    var largest: Pair<Int, Int>? = null

    for ((size, _) in woodSizes) {
        val (width, height) = size

        if (smallest == null || width < smallest.first) {
            smallest = Pair(width, height)
        }

        if (largest == null || width > largest.first) {
            largest = Pair(width, height)
        }
    }

    return Pair(smallest!!, largest!!)
}