/**
 * This function finds the intersection of three infinite while loops using the OR operator.
 */
fun intersectionLoop(num1: Int, num2: Int, num3: Int): Int {

    var result: Int? = null
    var tempNum1 = num1
    var tempNum2 = num2
    var tempNum3 = num3

    while (true) {
        if ((tempNum1 % 3 == 0 || tempNum1 % 5 == 0) &&
            (tempNum2 % 3 == 0 || tempNum2 % 5 == 0) &&
            (tempNum3 % 3 == 0 || tempNum3 % 5 == 0)
        ) {
            result = tempNum1
            break
        }
        tempNum1++
        tempNum2++
        tempNum3++
    }

    return result ?: 0
}
/**
 * This function finds the intersection of three infinite while loops using the OR operator.
 */
fun intersectionLoop(num1: Int, num2: Int, num3: Int): Int {
/**
 * This function finds the intersection of three infinite while loops using the OR operator.
 */
fun intersectionLoop(num1: Int, num2: Int, num3: Int): Int {

    var result: Int? = null
    var tempNum1 = num1
    var tempNum2 = num2
    var tempNum3 = num3

    while (true) {
        if ((tempNum1 % 3 == 0 || tempNum1 % 5 == 0) &&
            (tempNum2 % 3 == 0 || tempNum2 % 5 == 0) &&
            (tempNum3 % 3 == 0 || tempNum3 % 5 == 0)
        ) {
            result = tempNum1
            break
        }
        tempNum1++
        tempNum2++
        tempNum3++
    }

    return result ?: 0
}