/**
 * Counts the number of set bits (i.e., 1s) in the binary representation of a given number.
 *
 * @param num An integer
 * @return An integer representing the count of set bits in the binary representation of num
 */
fun countSetBits(num: Int): Int {

    var count = 0
    var n = num
    while (n != 0) {
        count++
        n = n and (n - 1)
    }
    return count
}

fun countSetBitsInList(lst: List<Int>, n: Int): Int {
    var count = 0
    for (num in lst) {
        if (countSetBits(num) % 2 == 1 && num % n == 0) {
            count++
        }
    }
    return count
}
/**
 * Counts the number of set bits (i.e., 1s) in the binary representation of a given number.
 *
 * @param num An integer
 * @return An integer representing the count of set bits in the binary representation of num
 */
fun countSetBits(num: Int): Int {
/**
 * Counts the number of set bits (i.e., 1s) in the binary representation of a given number.
 *
 * @param num An integer
 * @return An integer representing the count of set bits in the binary representation of num
 */
fun countSetBits(num: Int): Int {

    var count = 0
    var n = num
    while (n != 0) {
        count++
        n = n and (n - 1)
    }
    return count
}

fun countSetBitsInList(lst: List<Int>, n: Int): Int {
    var count = 0
    for (num in lst) {
        if (countSetBits(num) % 2 == 1 && num % n == 0) {
            count++
        }
    }
    return count
}