/**
 * This function takes a list of artists and a comparison value (an artist) as inputs.
 * It then returns a list of artists from the given list that have similarity with the comparison value.
 *
 * @param artists A list of artists.
 * @param comparisonValue An artist for comparison.
 * @return A list of artists from the given list that are similar to the comparisonValue.
 *
 * Example:
 * val artists = listOf("Mozart", "Beethoven", "Bach", "Chopin", "Handel", "Vivaldi")
 * val comparisonValue = "Mozart"
 * findSimilarArtists(artists, comparisonValue) // Output: ["Beethoven", "Chopin", "Vivaldi"]
 */
fun findSimilarArtists(artists: List<String>, comparisonValue: String): List<String> {

    val similarArtists = mutableListOf<String>()

    for (artist in artists) {
        if (artist != comparisonValue) {
            var similarity = 0
            for (i in 0 until minOf(artist.length, comparisonValue.length)) {
                if (artist[i] == comparisonValue[i]) {
                    similarity++
                }
            }
            if (similarity >= 2) {
                similarArtists.add(artist)
            }
        }
    }

    return similarArtists
}
/**
 * This function takes a list of artists and a comparison value (an artist) as inputs.
 * It then returns a list of artists from the given list that have similarity with the comparison value.
 *
 * @param artists A list of artists.
 * @param comparisonValue An artist for comparison.
 * @return A list of artists from the given list that are similar to the comparisonValue.
 *
 * Example:
 * val artists = listOf("Mozart", "Beethoven", "Bach", "Chopin", "Handel", "Vivaldi")
 * val comparisonValue = "Mozart"
 * findSimilarArtists(artists, comparisonValue) // Output: ["Beethoven", "Chopin", "Vivaldi"]
 */
fun findSimilarArtists(artists: List<String>, comparisonValue: String): List<String> {
/**
 * This function takes a list of artists and a comparison value (an artist) as inputs.
 * It then returns a list of artists from the given list that have similarity with the comparison value.
 *
 * @param artists A list of artists.
 * @param comparisonValue An artist for comparison.
 * @return A list of artists from the given list that are similar to the comparisonValue.
 *
 * Example:
 * val artists = listOf("Mozart", "Beethoven", "Bach", "Chopin", "Handel", "Vivaldi")
 * val comparisonValue = "Mozart"
 * findSimilarArtists(artists, comparisonValue) // Output: ["Beethoven", "Chopin", "Vivaldi"]
 */
fun findSimilarArtists(artists: List<String>, comparisonValue: String): List<String> {

    val similarArtists = mutableListOf<String>()

    for (artist in artists) {
        if (artist != comparisonValue) {
            var similarity = 0
            for (i in 0 until minOf(artist.length, comparisonValue.length)) {
                if (artist[i] == comparisonValue[i]) {
                    similarity++
                }
            }
            if (similarity >= 2) {
                similarArtists.add(artist)
            }
        }
    }

    return similarArtists
}