<commit_before>package leetcode

/**
 * https://leetcode.com/problems/largest-combination-with-bitwise-and-greater-than-zero/
 */
class Problem2275 {
    fun largestCombination(candidates: IntArray): Int {
        TODO()
    }
}

fun main() {
    val prob = Problem2275()
    println(prob.largestCombination(intArrayOf(16,17,71,62,12,24,14))) // 4
    println(prob.largestCombination(intArrayOf(8,8))) // 2
}<commit_msg>Solve problem 2275<commit_after>package leetcode

import kotlin.math.max

/**
 * https://leetcode.com/problems/largest-combination-with-bitwise-and-greater-than-zero/
 */
class Problem2275 {
    fun largestCombination(candidates: IntArray): Int {
        var answer = 0
        var i = 1
        while (i < 10000000) {
            var count = 0
            for (candidate in candidates) {
                if (candidate and i > 0) {
                    count++
                }
            }
            answer = max(answer, count)
            i = i shl 1
        }
        return answer
    }
}
{'fraction_non_alphanumeric': 0.12019704433497537, 'fraction_numerical': 0.04630541871921182, 'mean_word_length': 2.097560975609756, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 1, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6526695', 'n_tokens_mistral': 364, 'n_tokens_neox': 317, 'n_words': 63}