/**
 * Exercise:
 * Given a dictionary containing user information, the function should check if the user's age is greater than 18.
 * If the age is greater than 18, it should return "Access granted".
 * Otherwise, it should return "Access denied".
 *
 * @param user_data A dictionary containing user information.
 * @return Either "Access granted" or "Access denied" based on the age of the user.
 *
 * Example:
 * val user_data = mapOf(
 *     "name" to "John Doe",
 *     "age" to 22,
 *     "email" to "john.doe@example.com"
 * )
 * validateUser(user_data) // Output: "Access granted"
 */
fun validateUser(user_data: Map<String, Any>): String {

    // Access the user's age from the user_data dictionary
    val userAge = user_data["age"] as Int

    // Check if the user's age is greater than 18
    return if (userAge > 18) {
        "Access granted"
    } else {
        "Access denied"
    }
}
/**
 * Exercise:
 * Given a dictionary containing user information, the function should check if the user's age is greater than 18.
 * If the age is greater than 18, it should return "Access granted".
 * Otherwise, it should return "Access denied".
 *
 * @param user_data A dictionary containing user information.
 * @return Either "Access granted" or "Access denied" based on the age of the user.
 *
 * Example:
 * val user_data = mapOf(
 *     "name" to "John Doe",
 *     "age" to 22,
 *     "email" to "john.doe@example.com"
 * )
 * validateUser(user_data) // Output: "Access granted"
 */
fun validateUser(user_data: Map<String, Any>): String {
/**
 * Exercise:
 * Given a dictionary containing user information, the function should check if the user's age is greater than 18.
 * If the age is greater than 18, it should return "Access granted".
 * Otherwise, it should return "Access denied".
 *
 * @param user_data A dictionary containing user information.
 * @return Either "Access granted" or "Access denied" based on the age of the user.
 *
 * Example:
 * val user_data = mapOf(
 *     "name" to "John Doe",
 *     "age" to 22,
 *     "email" to "john.doe@example.com"
 * )
 * validateUser(user_data) // Output: "Access granted"
 */
fun validateUser(user_data: Map<String, Any>): String {

    // Access the user's age from the user_data dictionary
    val userAge = user_data["age"] as Int

    // Check if the user's age is greater than 18
    return if (userAge > 18) {
        "Access granted"
    } else {
        "Access denied"
    }
}