/**
 * You are given a list of names. Write a code that:
 * - Iterates through each name in the list
 * - Checks if the name contains the letter 'a'
 * - If the name doesn't contain 'a', skips it and continues to the next name
 * - Prints the names that do contain 'a' along with their position/index in the list
 *
 * @param namesList A list of names
 */
fun controlLoopExample(namesList: List<String>) {

    var count = 0  // Counter to keep track of current index

    for ((index, name) in namesList.withIndex()) {
        if ('a' !in name) {
            continue  // Skip to the next name if 'a' is not present
        }

        println("Name at index $count: $name")  // Print name with its index in the list
        count++
    }
}
/**
 * You are given a list of names. Write a code that:
 * - Iterates through each name in the list
 * - Checks if the name contains the letter 'a'
 * - If the name doesn't contain 'a', skips it and continues to the next name
 * - Prints the names that do contain 'a' along with their position/index in the list
 *
 * @param namesList A list of names
 */
fun controlLoopExample(namesList: List<String>) {
/**
 * You are given a list of names. Write a code that:
 * - Iterates through each name in the list
 * - Checks if the name contains the letter 'a'
 * - If the name doesn't contain 'a', skips it and continues to the next name
 * - Prints the names that do contain 'a' along with their position/index in the list
 *
 * @param namesList A list of names
 */
fun controlLoopExample(namesList: List<String>) {

    var count = 0  // Counter to keep track of current index

    for ((index, name) in namesList.withIndex()) {
        if ('a' !in name) {
            continue  // Skip to the next name if 'a' is not present
        }

        println("Name at index $count: $name")  // Print name with its index in the list
        count++
    }
}