<commit_before><commit_msg>Added solution to HackerRank - ACM ICPC Team<commit_after>//
//  ACMICPC.swift
//
//  Practice solution - <NAME> - 2021
//
//  Check the problem (and run the code) on HackerRank @ https://www.hackerrank.com/challenges/acm-icpc-team/
//  Note: make sure that you select "Swift" from the top-right language menu of the code editor when testing this code
//

func acmTeam(topic: [String]) -> [Int] {
    let input = convertStrArrayToBool(topic)
    var output = [0, 0]
    
    for first in 0 ..< input.count - 1 {
        for second in first + 1 ..< input.count {
            var count = 0
            for i in 0 ..< input[first].count {
                if input[first][i] || input[second][i] {
                    count += 1
                }
            }
            if count > output[0] {
                output[0] = count
                output[1] = 1
            } else if count == output[0] {
                output[1] += 1
            }
        }
    }
    
    return output
}

func convertStrArrayToBool(_ strings: [String]) -> [[Bool]] {
    return strings.map({ convertStrToBoolArray($0) })
}

func convertStrToBoolArray(_ str: String) -> [Bool] {
    return str.map({ $0 == "1" })
}

{'fraction_non_alphanumeric': 0.13185913185913187, 'fraction_numerical': 0.018018018018018018, 'mean_word_length': 1.783599088838269, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 8, 'https://': 1, 'lorem ipsum': 0, 'www.': 1, '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': '2849345', 'n_tokens_mistral': 398, 'n_tokens_neox': 372, 'n_words': 110}