/**
 * This function takes in the current color of the wall, the desired color, and
 * a list of available colors. It returns the number of cans of paint needed
 * to change the wall color and a message indicating whether it is possible to
 * change the color or not.
 *
 * @param currentColor The current color of the wall.
 * @param desiredColor The desired color of the wall.
 * @param availableColors A list of available colors.
 * @return A pair containing the number of cans of paint needed and a message.
 */
fun changeWallColor(currentColor: String, desiredColor: String, availableColors: List<String>): Pair<Int, String> {

    if (currentColor !in availableColors) {
        return Pair(0, "Invalid current color. Please choose from the available colors.")
    }

    if (desiredColor !in availableColors) {
        return Pair(0, "Invalid desired color. Please choose from the available colors.")
    }

    if (currentColor == desiredColor) {
        return Pair(0, "Current and desired colors are the same. No paint needed.")
    }

    // Calculate the number of cans needed to change the color
    val cansNeeded = Math.abs(availableColors.indexOf(currentColor) - availableColors.indexOf(desiredColor))

    var message = ""
    if (cansNeeded <= 2) {
        // Add any specific message here based on the number of cans needed
    }

    return Pair(cansNeeded, message)
}
/**
 * This function takes in the current color of the wall, the desired color, and
 * a list of available colors. It returns the number of cans of paint needed
 * to change the wall color and a message indicating whether it is possible to
 * change the color or not.
 *
 * @param currentColor The current color of the wall.
 * @param desiredColor The desired color of the wall.
 * @param availableColors A list of available colors.
 * @return A pair containing the number of cans of paint needed and a message.
 */
fun changeWallColor(currentColor: String, desiredColor: String, availableColors: List<String>): Pair<Int, String> {
/**
 * This function takes in the current color of the wall, the desired color, and
 * a list of available colors. It returns the number of cans of paint needed
 * to change the wall color and a message indicating whether it is possible to
 * change the color or not.
 *
 * @param currentColor The current color of the wall.
 * @param desiredColor The desired color of the wall.
 * @param availableColors A list of available colors.
 * @return A pair containing the number of cans of paint needed and a message.
 */
fun changeWallColor(currentColor: String, desiredColor: String, availableColors: List<String>): Pair<Int, String> {

    if (currentColor !in availableColors) {
        return Pair(0, "Invalid current color. Please choose from the available colors.")
    }

    if (desiredColor !in availableColors) {
        return Pair(0, "Invalid desired color. Please choose from the available colors.")
    }

    if (currentColor == desiredColor) {
        return Pair(0, "Current and desired colors are the same. No paint needed.")
    }

    // Calculate the number of cans needed to change the color
    val cansNeeded = Math.abs(availableColors.indexOf(currentColor) - availableColors.indexOf(desiredColor))

    var message = ""
    if (cansNeeded <= 2) {
        // Add any specific message here based on the number of cans needed
    }

    return Pair(cansNeeded, message)
}