/**
 * This exercise aims to test your understanding of if-else statements and subtraction.
 * The function takes two integers as input and should return the intersection of their absolute difference
 * and the range(0, 100) using a complex calculation involving subtraction.
 * Your task is to complete the code by implementing the missing lines.
 */
fun intersectionExercise(x: Int, y: Int): Int {

    var result: Int? = null
    val diff = Math.abs(x - y)

    // Calculate the intersection
    result = if (diff < 100) {
        if (x > y) {
            diff
        } else if (x < y) {
            -diff
        } else {
            0
        }
    } else {
        if (x > y) {
            diff % 100
        } else if (x < y) {
            -diff % 100
        } else {
            0
        }
    }

    return result
}
/**
 * This exercise aims to test your understanding of if-else statements and subtraction.
 * The function takes two integers as input and should return the intersection of their absolute difference
 * and the range(0, 100) using a complex calculation involving subtraction.
 * Your task is to complete the code by implementing the missing lines.
 */
fun intersectionExercise(x: Int, y: Int): Int {
/**
 * This exercise aims to test your understanding of if-else statements and subtraction.
 * The function takes two integers as input and should return the intersection of their absolute difference
 * and the range(0, 100) using a complex calculation involving subtraction.
 * Your task is to complete the code by implementing the missing lines.
 */
fun intersectionExercise(x: Int, y: Int): Int {

    var result: Int? = null
    val diff = Math.abs(x - y)

    // Calculate the intersection
    result = if (diff < 100) {
        if (x > y) {
            diff
        } else if (x < y) {
            -diff
        } else {
            0
        }
    } else {
        if (x > y) {
            diff % 100
        } else if (x < y) {
            -diff % 100
        } else {
            0
        }
    }

    return result
}