/**
 * Find the nth last character in the given name.
 *
 * @param name The name of the actor/actress.
 * @param n The position of the character to find (counting from the end of the name).
 * @return The nth last character in the given name.
 *
 * Example:
 * findNthLastCharacter("Johnny Depp", 2) => 'p'
 * findNthLastCharacter("Emma Watson", 4) => 't'
 */
fun findNthLastCharacter(name: String, n: Int): Char {

    // Get the last n characters from the name using negative indexing
    val lastNCharacters = name.takeLast(n)

    // Return the last character in the lastNCharacters string
    return lastNCharacters.last()
}
/**
 * Find the nth last character in the given name.
 *
 * @param name The name of the actor/actress.
 * @param n The position of the character to find (counting from the end of the name).
 * @return The nth last character in the given name.
 *
 * Example:
 * findNthLastCharacter("Johnny Depp", 2) => 'p'
 * findNthLastCharacter("Emma Watson", 4) => 't'
 */
fun findNthLastCharacter(name: String, n: Int): Char {
/**
 * Find the nth last character in the given name.
 *
 * @param name The name of the actor/actress.
 * @param n The position of the character to find (counting from the end of the name).
 * @return The nth last character in the given name.
 *
 * Example:
 * findNthLastCharacter("Johnny Depp", 2) => 'p'
 * findNthLastCharacter("Emma Watson", 4) => 't'
 */
fun findNthLastCharacter(name: String, n: Int): Char {

    // Get the last n characters from the name using negative indexing
    val lastNCharacters = name.takeLast(n)

    // Return the last character in the lastNCharacters string
    return lastNCharacters.last()
}