/**
 * Given two lists, 'myFriends' and 'myNetwork', find the first friend 
 * who is not in the network.
 *
 * Use list comprehension and the index() method to solve this exercise.
 *
 * @param myFriends A list of friends.
 * @param myNetwork A list of people in the network.
 * @return The first friend who is not in the network.
 */
fun findFriend(myFriends: List<String>, myNetwork: List<String>): String {

    val nonNetworkFriends = myFriends.filter { friend -> friend !in myNetwork }
    val firstNonNetworkFriend = if (nonNetworkFriends.isNotEmpty()) nonNetworkFriends[0] else "All friends are in the network."
    
    return firstNonNetworkFriend
}
/**
 * Given two lists, 'myFriends' and 'myNetwork', find the first friend 
 * who is not in the network.
 *
 * Use list comprehension and the index() method to solve this exercise.
 *
 * @param myFriends A list of friends.
 * @param myNetwork A list of people in the network.
 * @return The first friend who is not in the network.
 */
fun findFriend(myFriends: List<String>, myNetwork: List<String>): String {
/**
 * Given two lists, 'myFriends' and 'myNetwork', find the first friend 
 * who is not in the network.
 *
 * Use list comprehension and the index() method to solve this exercise.
 *
 * @param myFriends A list of friends.
 * @param myNetwork A list of people in the network.
 * @return The first friend who is not in the network.
 */
fun findFriend(myFriends: List<String>, myNetwork: List<String>): String {

    val nonNetworkFriends = myFriends.filter { friend -> friend !in myNetwork }
    val firstNonNetworkFriend = if (nonNetworkFriends.isNotEmpty()) nonNetworkFriends[0] else "All friends are in the network."
    
    return firstNonNetworkFriend
}