/**
 * This function takes two strings as input and concatenates them using a while loop.
 *
 * @param string1 The first string.
 * @param string2 The second string.
 * @return The concatenated string.
 */
fun concatenateStrings(string1: String, string2: String): String {

    var result = ""
    var i = 0
    while (i < string1.length) {
        var j = 0
        while (j < string2.length) {
            if (string1[i] == string2[j]) {
                result += string1[i]
            }
            j++
        }
        i++
    }
    return result
}
/**
 * This function takes two strings as input and concatenates them using a while loop.
 *
 * @param string1 The first string.
 * @param string2 The second string.
 * @return The concatenated string.
 */
fun concatenateStrings(string1: String, string2: String): String {
/**
 * This function takes two strings as input and concatenates them using a while loop.
 *
 * @param string1 The first string.
 * @param string2 The second string.
 * @return The concatenated string.
 */
fun concatenateStrings(string1: String, string2: String): String {

    var result = ""
    var i = 0
    while (i < string1.length) {
        var j = 0
        while (j < string2.length) {
            if (string1[i] == string2[j]) {
                result += string1[i]
            }
            j++
        }
        i++
    }
    return result
}