/**
 * This function takes in two sets:
 * - pieces: A set of lengths of wooden pieces the carpenter needs to cut.
 * - knownLengths: A set of lengths of wooden pieces the carpenter already has.
 *
 * The function returns a set of missing lengths that the carpenter needs to obtain
 * in order to complete all the required pieces.
 *
 * Example:
 * calculateMissingLengths(setOf(1.5, 2.0, 3.2, 4.6), setOf(2.0, 3.2, 4.6))
 * Output: setOf(1.5)
 */
fun calculateMissingLengths(pieces: Set<Double>, knownLengths: Set<Double>): Set<Double> {

    val missingLengths = mutableSetOf<Double>()

    for (piece in pieces) {
        if (piece !in knownLengths) {
            missingLengths.add(piece)
        }
    }

    return missingLengths
}
/**
 * This function takes in two sets:
 * - pieces: A set of lengths of wooden pieces the carpenter needs to cut.
 * - knownLengths: A set of lengths of wooden pieces the carpenter already has.
 *
 * The function returns a set of missing lengths that the carpenter needs to obtain
 * in order to complete all the required pieces.
 *
 * Example:
 * calculateMissingLengths(setOf(1.5, 2.0, 3.2, 4.6), setOf(2.0, 3.2, 4.6))
 * Output: setOf(1.5)
 */
fun calculateMissingLengths(pieces: Set<Double>, knownLengths: Set<Double>): Set<Double> {
/**
 * This function takes in two sets:
 * - pieces: A set of lengths of wooden pieces the carpenter needs to cut.
 * - knownLengths: A set of lengths of wooden pieces the carpenter already has.
 *
 * The function returns a set of missing lengths that the carpenter needs to obtain
 * in order to complete all the required pieces.
 *
 * Example:
 * calculateMissingLengths(setOf(1.5, 2.0, 3.2, 4.6), setOf(2.0, 3.2, 4.6))
 * Output: setOf(1.5)
 */
fun calculateMissingLengths(pieces: Set<Double>, knownLengths: Set<Double>): Set<Double> {

    val missingLengths = mutableSetOf<Double>()

    for (piece in pieces) {
        if (piece !in knownLengths) {
            missingLengths.add(piece)
        }
    }

    return missingLengths
}