/**
 * This function takes a list of songs and a specific genre as input, and returns a new list
 * containing only the songs from the provided genre.
 *
 * @param songs a list of songs (e.g., ["song1", "song2", "song3"])
 * @param genre a string representing the genre to filter the songs (e.g., "rock")
 * @return a new list containing only the songs from the specified genre
 */
fun divideSongsByGenre(songs: List<String>, genre: String): List<String> {

    val newList = mutableListOf<String>()
    for (song in songs) {
        // Split the song name using "-" to extract the genre
        val songParts = song.split("-")
        if (songParts.size < 2) {
            continue
        }
        val songGenre = songParts[1].trim().toLowerCase()
        if (songGenre == genre.toLowerCase()) {
            newList.add(song)
        }
    }
    return newList
}
/**
 * This function takes a list of songs and a specific genre as input, and returns a new list
 * containing only the songs from the provided genre.
 *
 * @param songs a list of songs (e.g., ["song1", "song2", "song3"])
 * @param genre a string representing the genre to filter the songs (e.g., "rock")
 * @return a new list containing only the songs from the specified genre
 */
fun divideSongsByGenre(songs: List<String>, genre: String): List<String> {
/**
 * This function takes a list of songs and a specific genre as input, and returns a new list
 * containing only the songs from the provided genre.
 *
 * @param songs a list of songs (e.g., ["song1", "song2", "song3"])
 * @param genre a string representing the genre to filter the songs (e.g., "rock")
 * @return a new list containing only the songs from the specified genre
 */
fun divideSongsByGenre(songs: List<String>, genre: String): List<String> {

    val newList = mutableListOf<String>()
    for (song in songs) {
        // Split the song name using "-" to extract the genre
        val songParts = song.split("-")
        if (songParts.size < 2) {
            continue
        }
        val songGenre = songParts[1].trim().toLowerCase()
        if (songGenre == genre.toLowerCase()) {
            newList.add(song)
        }
    }
    return newList
}