/**
 * Create a band with the given musicians.
 *
 * @param musicians a map where the keys are the instrument names and the values are lists of musician names
 * @return a list of pairs, each containing a musician and their instrument
 *
 * Example:
 * createBand(mapOf("guitar" to listOf("John", "David"), "drums" to listOf("Mike", "Alex"), "bass" to listOf("Peter", "Sam")))
 * Output: [("John", "guitar"), ("David", "guitar"), ("Mike", "drums"), ("Alex", "drums"), ("Peter", "bass"), ("Sam", "bass")]
 */
fun createBand(musicians: Map<String, List<String>>): List<Pair<String, String>> {

    val band = mutableListOf<Pair<String, String>>()

    musicians.forEach { instrument, musicianList ->
        musicianList.forEach { musician ->
            band.add(musician to instrument)
        }
    }

    return band
}
/**
 * Create a band with the given musicians.
 *
 * @param musicians a map where the keys are the instrument names and the values are lists of musician names
 * @return a list of pairs, each containing a musician and their instrument
 *
 * Example:
 * createBand(mapOf("guitar" to listOf("John", "David"), "drums" to listOf("Mike", "Alex"), "bass" to listOf("Peter", "Sam")))
 * Output: [("John", "guitar"), ("David", "guitar"), ("Mike", "drums"), ("Alex", "drums"), ("Peter", "bass"), ("Sam", "bass")]
 */
fun createBand(musicians: Map<String, List<String>>): List<Pair<String, String>> {
/**
 * Create a band with the given musicians.
 *
 * @param musicians a map where the keys are the instrument names and the values are lists of musician names
 * @return a list of pairs, each containing a musician and their instrument
 *
 * Example:
 * createBand(mapOf("guitar" to listOf("John", "David"), "drums" to listOf("Mike", "Alex"), "bass" to listOf("Peter", "Sam")))
 * Output: [("John", "guitar"), ("David", "guitar"), ("Mike", "drums"), ("Alex", "drums"), ("Peter", "bass"), ("Sam", "bass")]
 */
fun createBand(musicians: Map<String, List<String>>): List<Pair<String, String>> {

    val band = mutableListOf<Pair<String, String>>()

    musicians.forEach { instrument, musicianList ->
        musicianList.forEach { musician ->
            band.add(musician to instrument)
        }
    }

    return band
}