/**
 * This function takes two strings as input and returns the common substring between them.
 *
 * @param str1 The first string.
 * @param str2 The second string.
 * @return The common substring between str1 and str2.
 */
fun findCommonSubstring(str1: String, str2: String): String {

    var commonSubstring = ""

    if (str1.isEmpty() || str2.isEmpty()) {
        return commonSubstring
    }

    for (i in str1.indices) {
        for (j in i + 1..str1.length) {
            val substring = str1.substring(i, j)

            if (str2.contains(substring)) {
                if (substring.length > commonSubstring.length) {
                    commonSubstring = substring
                }
            }
        }
    }

    return commonSubstring
}
/**
 * This function takes two strings as input and returns the common substring between them.
 *
 * @param str1 The first string.
 * @param str2 The second string.
 * @return The common substring between str1 and str2.
 */
fun findCommonSubstring(str1: String, str2: String): String {
/**
 * This function takes two strings as input and returns the common substring between them.
 *
 * @param str1 The first string.
 * @param str2 The second string.
 * @return The common substring between str1 and str2.
 */
fun findCommonSubstring(str1: String, str2: String): String {

    var commonSubstring = ""

    if (str1.isEmpty() || str2.isEmpty()) {
        return commonSubstring
    }

    for (i in str1.indices) {
        for (j in i + 1..str1.length) {
            val substring = str1.substring(i, j)

            if (str2.contains(substring)) {
                if (substring.length > commonSubstring.length) {
                    commonSubstring = substring
                }
            }
        }
    }

    return commonSubstring
}