/**
 * Given two lists representing the instruments of two bands, return a new list containing the instruments
 * that are common to both bands.
 *
 * @param band1 A list representing the instruments of the first band.
 * @param band2 A list representing the instruments of the second band.
 * @return A list containing the instruments common to both bands.
 *
 * Example:
 * getCommonInstruments(listOf("guitar", "drums", "bass"), listOf("piano", "drums")) -> listOf("drums")
 */
fun getCommonInstruments(band1: List<String>, band2: List<String>): List<String> {

    val commonInstruments = mutableListOf<String>()

    for (instrument in band1) {
        if (instrument in band2) {
            commonInstruments.add(instrument)
        }
    }

    return commonInstruments
}
/**
 * Given two lists representing the instruments of two bands, return a new list containing the instruments
 * that are common to both bands.
 *
 * @param band1 A list representing the instruments of the first band.
 * @param band2 A list representing the instruments of the second band.
 * @return A list containing the instruments common to both bands.
 *
 * Example:
 * getCommonInstruments(listOf("guitar", "drums", "bass"), listOf("piano", "drums")) -> listOf("drums")
 */
fun getCommonInstruments(band1: List<String>, band2: List<String>): List<String> {
/**
 * Given two lists representing the instruments of two bands, return a new list containing the instruments
 * that are common to both bands.
 *
 * @param band1 A list representing the instruments of the first band.
 * @param band2 A list representing the instruments of the second band.
 * @return A list containing the instruments common to both bands.
 *
 * Example:
 * getCommonInstruments(listOf("guitar", "drums", "bass"), listOf("piano", "drums")) -> listOf("drums")
 */
fun getCommonInstruments(band1: List<String>, band2: List<String>): List<String> {

    val commonInstruments = mutableListOf<String>()

    for (instrument in band1) {
        if (instrument in band2) {
            commonInstruments.add(instrument)
        }
    }

    return commonInstruments
}