/**
 * Given a string containing the name of an actor/actress, creates a Pair containing their first name and last name.
 * Considers the precedence of logical operators while solving this exercise.
 */
fun name(actorString: String): Pair<String, String> {

    // Find the index of the first space character in the string
    val firstSpaceIndex = actorString.indexOf(' ')

    // Find the index of the last space character in the string
    val lastSpaceIndex = actorString.lastIndexOf(' ')

    // Slice the string to extract the first name
    val firstName = actorString.substring(0, firstSpaceIndex)

    // Slice the string to extract the last name
    val lastName = actorString.substring(lastSpaceIndex + 1)

    // Create a Pair containing the first name and last name
    return Pair(firstName, lastName)
}
/**
 * Given a string containing the name of an actor/actress, creates a Pair containing their first name and last name.
 * Considers the precedence of logical operators while solving this exercise.
 */
fun name(actorString: String): Pair<String, String> {
/**
 * Given a string containing the name of an actor/actress, creates a Pair containing their first name and last name.
 * Considers the precedence of logical operators while solving this exercise.
 */
fun name(actorString: String): Pair<String, String> {

    // Find the index of the first space character in the string
    val firstSpaceIndex = actorString.indexOf(' ')

    // Find the index of the last space character in the string
    val lastSpaceIndex = actorString.lastIndexOf(' ')

    // Slice the string to extract the first name
    val firstName = actorString.substring(0, firstSpaceIndex)

    // Slice the string to extract the last name
    val lastName = actorString.substring(lastSpaceIndex + 1)

    // Create a Pair containing the first name and last name
    return Pair(firstName, lastName)
}