/**
 * Given a list of strings 'data', a target string 'target', and a replacement string 'replacement',
 * replace all strings in 'data' that do not contain the 'target' string with the 'replacement' string.
 *
 * @param data A list of strings.
 * @param target A target string.
 * @param replacement A replacement string.
 * @return A new list of strings with replacements.
 *
 * Examples:
 * replaceNotIn(listOf("apple", "banana", "kiwi", "orange"), "a", "fruit") // ['apple', 'banana', 'fruit', 'fruit']
 * replaceNotIn(listOf("cat", "dog", "rabbit", "mouse"), "a", "animal") // ['animal', 'dog', 'rabbit', 'animal']
 */
fun replaceNotIn(data: List<String>, target: String, replacement: String): List<String> {

    return data.map { if (target !in it) replacement else it }
}
/**
 * Given a list of strings 'data', a target string 'target', and a replacement string 'replacement',
 * replace all strings in 'data' that do not contain the 'target' string with the 'replacement' string.
 *
 * @param data A list of strings.
 * @param target A target string.
 * @param replacement A replacement string.
 * @return A new list of strings with replacements.
 *
 * Examples:
 * replaceNotIn(listOf("apple", "banana", "kiwi", "orange"), "a", "fruit") // ['apple', 'banana', 'fruit', 'fruit']
 * replaceNotIn(listOf("cat", "dog", "rabbit", "mouse"), "a", "animal") // ['animal', 'dog', 'rabbit', 'animal']
 */
fun replaceNotIn(data: List<String>, target: String, replacement: String): List<String> {
/**
 * Given a list of strings 'data', a target string 'target', and a replacement string 'replacement',
 * replace all strings in 'data' that do not contain the 'target' string with the 'replacement' string.
 *
 * @param data A list of strings.
 * @param target A target string.
 * @param replacement A replacement string.
 * @return A new list of strings with replacements.
 *
 * Examples:
 * replaceNotIn(listOf("apple", "banana", "kiwi", "orange"), "a", "fruit") // ['apple', 'banana', 'fruit', 'fruit']
 * replaceNotIn(listOf("cat", "dog", "rabbit", "mouse"), "a", "animal") // ['animal', 'dog', 'rabbit', 'animal']
 */
fun replaceNotIn(data: List<String>, target: String, replacement: String): List<String> {

    return data.map { if (target !in it) replacement else it }
}