/**
 * This exercise aims to calculate the total length of the coastline based on the given coordinates of different geographical locations.
 *
 * Instructions:
 * - Use a loop to iterate through each coordinate tuple in the provided 'coordinates' list.
 * - Extract the second item from each coordinate tuple using indexing and slicing.
 * - Sum up the lengths to get the total coastline length.
 * - Finally, return the total coastline length.
 *
 * Note:
 * - The second item of each coordinate tuple represents the coastline length.
 * - The total coastline length can be a floating-point number.
 * - The 'coordinates' list contains tuples with geographical information.
 */
fun countCoastlineLength(coordinates: List<Pair<String, Double>>): Double {

    // Initialize a variable to store the total coastline length
    var totalLength = 0.0

    // Iterate through each coordinate in the 'coordinates' list
    for (coordinate in coordinates) {
        // Extract the coastline length (second item) from the coordinate tuple
        val coastlineLength = coordinate.second

        // Add the coastline length to the total length
        totalLength += coastlineLength
    }

    return totalLength
}
/**
 * This exercise aims to calculate the total length of the coastline based on the given coordinates of different geographical locations.
 *
 * Instructions:
 * - Use a loop to iterate through each coordinate tuple in the provided 'coordinates' list.
 * - Extract the second item from each coordinate tuple using indexing and slicing.
 * - Sum up the lengths to get the total coastline length.
 * - Finally, return the total coastline length.
 *
 * Note:
 * - The second item of each coordinate tuple represents the coastline length.
 * - The total coastline length can be a floating-point number.
 * - The 'coordinates' list contains tuples with geographical information.
 */
fun countCoastlineLength(coordinates: List<Pair<String, Double>>): Double {
/**
 * This exercise aims to calculate the total length of the coastline based on the given coordinates of different geographical locations.
 *
 * Instructions:
 * - Use a loop to iterate through each coordinate tuple in the provided 'coordinates' list.
 * - Extract the second item from each coordinate tuple using indexing and slicing.
 * - Sum up the lengths to get the total coastline length.
 * - Finally, return the total coastline length.
 *
 * Note:
 * - The second item of each coordinate tuple represents the coastline length.
 * - The total coastline length can be a floating-point number.
 * - The 'coordinates' list contains tuples with geographical information.
 */
fun countCoastlineLength(coordinates: List<Pair<String, Double>>): Double {

    // Initialize a variable to store the total coastline length
    var totalLength = 0.0

    // Iterate through each coordinate in the 'coordinates' list
    for (coordinate in coordinates) {
        // Extract the coastline length (second item) from the coordinate tuple
        val coastlineLength = coordinate.second

        // Add the coastline length to the total length
        totalLength += coastlineLength
    }

    return totalLength
}