/**
 * This function takes in two strings 'a' and 'b' and returns a list of common substrings present in both strings. The substrings
 * are at least length 2 and are case-sensitive. The list is sorted in ascending order based on the length of the substrings.
 */
fun findCommonSubstrings(a: String, b: String): List<String> {

    val commonSubs = mutableListOf<String>()
    for (i in 0 until a.length - 1) {
        val substr = a.substring(i, i + 2)
        if (substr.length >= 2 && b.contains(substr) && substr !in commonSubs) {
            commonSubs.add(substr)
        }
    }
    return commonSubs.sorted()
}
/**
 * This function takes in two strings 'a' and 'b' and returns a list of common substrings present in both strings. The substrings
 * are at least length 2 and are case-sensitive. The list is sorted in ascending order based on the length of the substrings.
 */
fun findCommonSubstrings(a: String, b: String): List<String> {
/**
 * This function takes in two strings 'a' and 'b' and returns a list of common substrings present in both strings. The substrings
 * are at least length 2 and are case-sensitive. The list is sorted in ascending order based on the length of the substrings.
 */
fun findCommonSubstrings(a: String, b: String): List<String> {

    val commonSubs = mutableListOf<String>()
    for (i in 0 until a.length - 1) {
        val substr = a.substring(i, i + 2)
        if (substr.length >= 2 && b.contains(substr) && substr !in commonSubs) {
            commonSubs.add(substr)
        }
    }
    return commonSubs.sorted()
}