/**
 * Given two musical notes (represented as integers), return the bitwise AND of their binary representation.
 *
 * @param note1 First musical note
 * @param note2 Second musical note
 * @return Bitwise AND of the binary representation of note1 and note2
 */
fun getCommonNotes(note1: Int, note2: Int): Int {

    // Convert the notes to binary strings
    val binaryNote1 = note1.toString(2).padStart(12, '0')
    val binaryNote2 = note2.toString(2).padStart(12, '0')

    // Perform the bitwise AND operation on each corresponding pair of bits
    var result = ""
    for ((bit1, bit2) in binaryNote1.zip(binaryNote2)) {
        result += (bit1.toString().toInt() and bit2.toString().toInt()).toString()
    }

    // Return the decimal value of the resulting binary string
    return result.toInt(2)
}
/**
 * Given two musical notes (represented as integers), return the bitwise AND of their binary representation.
 *
 * @param note1 First musical note
 * @param note2 Second musical note
 * @return Bitwise AND of the binary representation of note1 and note2
 */
fun getCommonNotes(note1: Int, note2: Int): Int {
/**
 * Given two musical notes (represented as integers), return the bitwise AND of their binary representation.
 *
 * @param note1 First musical note
 * @param note2 Second musical note
 * @return Bitwise AND of the binary representation of note1 and note2
 */
fun getCommonNotes(note1: Int, note2: Int): Int {

    // Convert the notes to binary strings
    val binaryNote1 = note1.toString(2).padStart(12, '0')
    val binaryNote2 = note2.toString(2).padStart(12, '0')

    // Perform the bitwise AND operation on each corresponding pair of bits
    var result = ""
    for ((bit1, bit2) in binaryNote1.zip(binaryNote2)) {
        result += (bit1.toString().toInt() and bit2.toString().toInt()).toString()
    }

    // Return the decimal value of the resulting binary string
    return result.toInt(2)
}