/**
 * Given a list of names and a string of common letters, 
 * remove all the common letters from each name in the list.
 *
 * @param names A list of names.
 * @param commonLetters A string of common letters to be removed.
 * @return Updated list of names with common letters removed.
 */
fun removeCommonLetters(names: MutableList<String>, commonLetters: String): MutableList<String> {

    var index = 0
    while (index < names.size) {
        var name = names[index]
        var i = 0
        while (i < name.length) {
            if (name[i] in commonLetters) {
                name = name.substring(0, i) + name.substring(i + 1)
            } else {
                i++
            }
        }
        names[index] = name
        index++
    }
    return names
}
/**
 * Given a list of names and a string of common letters, 
 * remove all the common letters from each name in the list.
 *
 * @param names A list of names.
 * @param commonLetters A string of common letters to be removed.
 * @return Updated list of names with common letters removed.
 */
fun removeCommonLetters(names: MutableList<String>, commonLetters: String): MutableList<String> {
/**
 * Given a list of names and a string of common letters, 
 * remove all the common letters from each name in the list.
 *
 * @param names A list of names.
 * @param commonLetters A string of common letters to be removed.
 * @return Updated list of names with common letters removed.
 */
fun removeCommonLetters(names: MutableList<String>, commonLetters: String): MutableList<String> {

    var index = 0
    while (index < names.size) {
        var name = names[index]
        var i = 0
        while (i < name.length) {
            if (name[i] in commonLetters) {
                name = name.substring(0, i) + name.substring(i + 1)
            } else {
                i++
            }
        }
        names[index] = name
        index++
    }
    return names
}