/**
 * Given a string and a map of replacement values, replaces all occurrences of a character in the string
 * with the corresponding value from the map.
 *
 * @param string A string in which replacements need to be made.
 * @param replaceMap A map containing characters as keys and their corresponding values as values.
 * @return The modified string after replacing the characters as per the replaceMap.
 */
fun replaceInString(string: String, replaceMap: Map<Char, Char>): String {

    var modifiedString = string
    for (i in string.indices) {
        if (string[i] in replaceMap) {
            modifiedString = modifiedString.substring(0, i) + replaceMap[string[i]] + modifiedString.substring(i + 1)
        }
    }
    return modifiedString
}
/**
 * Given a string and a map of replacement values, replaces all occurrences of a character in the string
 * with the corresponding value from the map.
 *
 * @param string A string in which replacements need to be made.
 * @param replaceMap A map containing characters as keys and their corresponding values as values.
 * @return The modified string after replacing the characters as per the replaceMap.
 */
fun replaceInString(string: String, replaceMap: Map<Char, Char>): String {
/**
 * Given a string and a map of replacement values, replaces all occurrences of a character in the string
 * with the corresponding value from the map.
 *
 * @param string A string in which replacements need to be made.
 * @param replaceMap A map containing characters as keys and their corresponding values as values.
 * @return The modified string after replacing the characters as per the replaceMap.
 */
fun replaceInString(string: String, replaceMap: Map<Char, Char>): String {

    var modifiedString = string
    for (i in string.indices) {
        if (string[i] in replaceMap) {
            modifiedString = modifiedString.substring(0, i) + replaceMap[string[i]] + modifiedString.substring(i + 1)
        }
    }
    return modifiedString
}