/**
 * This function removes duplicate coordinates from a given list of coordinates.
 *
 * @param coordinates A list of pairs representing x and y coordinates.
 * @return A new list without any duplicate coordinates.
 */
fun removeDuplicates(coordinates: List<Pair<Int, Int>>): List<Pair<Int, Int>> {

    val uniqueCoordinates = mutableListOf<Pair<Int, Int>>()

    // Iterate through each coordinate in the given list
    for (coordinate in coordinates) {
        // Check if the current coordinate is already present in the uniqueCoordinates list
        if (coordinate !in uniqueCoordinates) {
            // If the current coordinate is not present, add it to the uniqueCoordinates list
            uniqueCoordinates.add(coordinate)
        }
    }

    return uniqueCoordinates
}
/**
 * This function removes duplicate coordinates from a given list of coordinates.
 *
 * @param coordinates A list of pairs representing x and y coordinates.
 * @return A new list without any duplicate coordinates.
 */
fun removeDuplicates(coordinates: List<Pair<Int, Int>>): List<Pair<Int, Int>> {
/**
 * This function removes duplicate coordinates from a given list of coordinates.
 *
 * @param coordinates A list of pairs representing x and y coordinates.
 * @return A new list without any duplicate coordinates.
 */
fun removeDuplicates(coordinates: List<Pair<Int, Int>>): List<Pair<Int, Int>> {

    val uniqueCoordinates = mutableListOf<Pair<Int, Int>>()

    // Iterate through each coordinate in the given list
    for (coordinate in coordinates) {
        // Check if the current coordinate is already present in the uniqueCoordinates list
        if (coordinate !in uniqueCoordinates) {
            // If the current coordinate is not present, add it to the uniqueCoordinates list
            uniqueCoordinates.add(coordinate)
        }
    }

    return uniqueCoordinates
}