/**
 * Given two sets, find the sum of the common elements between them.
 * Each set contains positive integers only.
 *
 * @param set1 The first set of positive integers
 * @param set2 The second set of positive integers
 * @return The sum of the common elements between the sets
 */
fun sumOfCommonElements(set1: Set<Int>, set2: Set<Int>): Int {

    var commonSum = 0

    for (num1 in set1) {
        for (num2 in set2) {
            // Check if the division of the two numbers is an integer
            if (num1 % num2 == 0 || num2 % num1 == 0) {
                commonSum += num1 + num2
            }
        }
    }

    return commonSum
}
/**
 * Given two sets, find the sum of the common elements between them.
 * Each set contains positive integers only.
 *
 * @param set1 The first set of positive integers
 * @param set2 The second set of positive integers
 * @return The sum of the common elements between the sets
 */
fun sumOfCommonElements(set1: Set<Int>, set2: Set<Int>): Int {
/**
 * Given two sets, find the sum of the common elements between them.
 * Each set contains positive integers only.
 *
 * @param set1 The first set of positive integers
 * @param set2 The second set of positive integers
 * @return The sum of the common elements between the sets
 */
fun sumOfCommonElements(set1: Set<Int>, set2: Set<Int>): Int {

    var commonSum = 0

    for (num1 in set1) {
        for (num2 in set2) {
            // Check if the division of the two numbers is an integer
            if (num1 % num2 == 0 || num2 % num1 == 0) {
                commonSum += num1 + num2
            }
        }
    }

    return commonSum
}