/**
 * Given the coordinates (x, y) of two points A and B in a two-dimensional space,
 * calculate the Euclidean distance between them.
 */
fun calculateDistance(x1: Int, y1: Int, x2: Int, y2: Int): Double {

    // Calculate the difference between x-coordinates and y-coordinates
    val xDistance = Math.abs(x2 - x1)
    val yDistance = Math.abs(y2 - y1)

    // Calculate the square of the differences
    val xDistanceSquared = Math.pow(xDistance.toDouble(), 2.0)
    val yDistanceSquared = Math.pow(yDistance.toDouble(), 2.0)

    // Calculate the sum of the squared differences
    val sumOfSquares = xDistanceSquared + yDistanceSquared

    // Calculate the square root of the sum of the squared differences
    val distance = Math.pow(sumOfSquares, 0.5)

    return distance
}
/**
 * Given the coordinates (x, y) of two points A and B in a two-dimensional space,
 * calculate the Euclidean distance between them.
 */
fun calculateDistance(x1: Int, y1: Int, x2: Int, y2: Int): Double {
/**
 * Given the coordinates (x, y) of two points A and B in a two-dimensional space,
 * calculate the Euclidean distance between them.
 */
fun calculateDistance(x1: Int, y1: Int, x2: Int, y2: Int): Double {

    // Calculate the difference between x-coordinates and y-coordinates
    val xDistance = Math.abs(x2 - x1)
    val yDistance = Math.abs(y2 - y1)

    // Calculate the square of the differences
    val xDistanceSquared = Math.pow(xDistance.toDouble(), 2.0)
    val yDistanceSquared = Math.pow(yDistance.toDouble(), 2.0)

    // Calculate the sum of the squared differences
    val sumOfSquares = xDistanceSquared + yDistanceSquared

    // Calculate the square root of the sum of the squared differences
    val distance = Math.pow(sumOfSquares, 0.5)

    return distance
}