<commit_before>// https://leetcode.com/problems/number-of-common-factors/
pub fn common_factors(a: i32, b: i32) -> i32 {
    todo!()
}

fn main() {
    println!("{}", common_factors(12, 6)); // 4
    println!("{}", common_factors(25, 30)); // 2
    println!("{}", common_factors(8, 12)); // 3
    println!("{}", common_factors(50, 48)); // 2
    println!("{}", common_factors(50, 45)); // 2
    println!("{}", common_factors(12, 24)); // 6
}<commit_msg>Solve problem 2427<commit_after>// https://leetcode.com/problems/number-of-common-factors/
pub fn common_factors(a: i32, b: i32) -> i32 {
    let mut answer = 0;
    for i in 1..=a.min(b) {
        answer += if a % i == 0 && b % i == 0 { 1 } else { 0 };
    }
    answer
}

fn main() {
    println!("{}", common_factors(12, 6)); // 4
    println!("{}", common_factors(25, 30)); // 2
    println!("{}", common_factors(8, 12)); // 3
    println!("{}", common_factors(50, 48)); // 2
    println!("{}", common_factors(50, 45)); // 2
    println!("{}", common_factors(12, 24)); // 6
}
{'fraction_non_alphanumeric': 0.2441860465116279, 'fraction_numerical': 0.0755813953488372, 'mean_word_length': 3.03515625, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, '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': '232420', 'n_tokens_mistral': 461, 'n_tokens_neox': 382, 'n_words': 93}