/**
 * Given a list of beam data, calculate the forces at the intersection points using the enumerate function.
 *
 * @param beamData A list of pairs representing the beam data. Each pair contains the distance from the starting point
 * and the load at that point.
 * @return A list of forces at the intersection points.
 */
fun calcBeamForces(beamData: List<Pair<Int, Int>>): List<Int> {

    val forces = mutableListOf<Int>()

    // Loop through the beam data using the enumerate function
    for (i in beamData.indices) {
        val (distance, load) = beamData[i]
        
        // Make sure it is not the first or last point
        if (i != 0 && i != beamData.size - 1) {
            // Calculate the force at the intersection point by subtracting the load at the previous and next points
            val force = beamData[i + 1].second - beamData[i - 1].second
            forces.add(force)
        }
    }
    
    return forces
}
/**
 * Given a list of beam data, calculate the forces at the intersection points using the enumerate function.
 *
 * @param beamData A list of pairs representing the beam data. Each pair contains the distance from the starting point
 * and the load at that point.
 * @return A list of forces at the intersection points.
 */
fun calcBeamForces(beamData: List<Pair<Int, Int>>): List<Int> {
/**
 * Given a list of beam data, calculate the forces at the intersection points using the enumerate function.
 *
 * @param beamData A list of pairs representing the beam data. Each pair contains the distance from the starting point
 * and the load at that point.
 * @return A list of forces at the intersection points.
 */
fun calcBeamForces(beamData: List<Pair<Int, Int>>): List<Int> {

    val forces = mutableListOf<Int>()

    // Loop through the beam data using the enumerate function
    for (i in beamData.indices) {
        val (distance, load) = beamData[i]
        
        // Make sure it is not the first or last point
        if (i != 0 && i != beamData.size - 1) {
            // Calculate the force at the intersection point by subtracting the load at the previous and next points
            val force = beamData[i + 1].second - beamData[i - 1].second
            forces.add(force)
        }
    }
    
    return forces
}