<commit_before>//
//  Problem3.swift
//  ProjectEuler
//
//  Created by <NAME> on 08/05/16.
//  Copyright © 2016 <NAME>. All rights reserved.
//

import Foundation

class Problem3: Solvable {

    func solve() -> Int {
        return largestPrimeFactorOf(600851475143)
    }

    func largestPrimeFactorOf(number: Int) -> Int {
        var divisor = Int(sqrt(Float(number)))

        while divisor > 1 {
            if number % divisor == 0 && divisor.prime {
                return divisor
            }

            divisor -= 1
        }

        return 0
    }
    
}<commit_msg>Fix bug in Problem 3<commit_after>//
//  Problem3.swift
//  ProjectEuler
//
//  Created by <NAME> on 08/05/16.
//  Copyright © 2016 <NAME>. All rights reserved.
//

import Foundation

class Problem3: Solvable {

    func solve() -> Int {
        return largestPrimeFactorOf(600851475143)
    }

    func largestPrimeFactorOf(number: Int) -> Int {
        var divisor = Int(ceil(sqrt(Float(number))))

        while divisor > 1 {
            if number % divisor == 0 && divisor.prime {
                return divisor
            }

            divisor -= 1
        }

        return 0
    }
    
}
{'fraction_non_alphanumeric': 0.11365564037319763, 'fraction_numerical': 0.04834605597964377, 'mean_word_length': 1.6879271070615034, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 13, 'https://': 0, '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': '6942484', 'n_tokens_mistral': 410, 'n_tokens_neox': 339, 'n_words': 96}