/**
 * This function takes in a positive integer 'num' and returns the count of the number of binary
 * representations of integers between 1 and 'num', inclusive, that satisfy the given conditions.
 *
 * @param num A positive integer
 * @return The count of valid binary representations
 */
fun countBinaries(num: Int): Int {

    var count = 0

    for (i in 1..num) {
        val binary = i.toString(2)  // Convert integer 'i' to binary representation
        var valid = true

        // Check if the binary representation contains both left shift and right shift operators
        if ("<<" !in binary || ">>" !in binary) {
            valid = false
        }

        // Check if the binary representation contains at least one boolean expression in a loop
        if (!listOf("and", "or", "not").any { op -> op in binary }) {
            valid = false
        }

        if (valid) {
            count++
        }
    }

    return count
}
/**
 * This function takes in a positive integer 'num' and returns the count of the number of binary
 * representations of integers between 1 and 'num', inclusive, that satisfy the given conditions.
 *
 * @param num A positive integer
 * @return The count of valid binary representations
 */
fun countBinaries(num: Int): Int {
/**
 * This function takes in a positive integer 'num' and returns the count of the number of binary
 * representations of integers between 1 and 'num', inclusive, that satisfy the given conditions.
 *
 * @param num A positive integer
 * @return The count of valid binary representations
 */
fun countBinaries(num: Int): Int {

    var count = 0

    for (i in 1..num) {
        val binary = i.toString(2)  // Convert integer 'i' to binary representation
        var valid = true

        // Check if the binary representation contains both left shift and right shift operators
        if ("<<" !in binary || ">>" !in binary) {
            valid = false
        }

        // Check if the binary representation contains at least one boolean expression in a loop
        if (!listOf("and", "or", "not").any { op -> op in binary }) {
            valid = false
        }

        if (valid) {
            count++
        }
    }

    return count
}