/**
 * This function takes two parameters x and y, representing two points on a number line, and returns the intersection point.
 */
fun electricianNumberLine(x: Int, y: Int): Int {

    // Calculate the step parameter
    val step = 1

    // Determine the minimum and maximum values
    val minValue = minOf(x, y)
    val maxValue = maxOf(x, y)

    // Check if the intersection point exists
    if (minValue >= maxValue) {
        return 0 // No intersection point exists
    }

    var intersectionPoint: Int? = null

    // Loop through the range from minValue to maxValue with a step size of step
    for (i in minValue until maxValue step step) {
        if (i == 0) {
            return i // Intersection point found at 0
        } else if (x % i == 0 && y % i == 0) {
            intersectionPoint = i
        }
    }

    return intersectionPoint ?: 0
}
/**
 * This function takes two parameters x and y, representing two points on a number line, and returns the intersection point.
 */
fun electricianNumberLine(x: Int, y: Int): Int {
/**
 * This function takes two parameters x and y, representing two points on a number line, and returns the intersection point.
 */
fun electricianNumberLine(x: Int, y: Int): Int {

    // Calculate the step parameter
    val step = 1

    // Determine the minimum and maximum values
    val minValue = minOf(x, y)
    val maxValue = maxOf(x, y)

    // Check if the intersection point exists
    if (minValue >= maxValue) {
        return 0 // No intersection point exists
    }

    var intersectionPoint: Int? = null

    // Loop through the range from minValue to maxValue with a step size of step
    for (i in minValue until maxValue step step) {
        if (i == 0) {
            return i // Intersection point found at 0
        } else if (x % i == 0 && y % i == 0) {
            intersectionPoint = i
        }
    }

    return intersectionPoint ?: 0
}