<commit_before>import math

def main():

    # initialize cnt and p with the values given
    max_cnt, max_p = 3, 10

    for p in range(12, 1001):
        # initialize count every time p gets updated
        cnt = 0
        # c : hypotenuse
        min_c, max_c = round(p/3)+1, p-1

        for c in range(min_c, max_c):

            b_list = []
            a = c-1
            if a+c >= p:
                continue

            while (a not in b_list) and (a > 0):
                b = p-(c+a)
                b_list.append(b)
                
                if c**2 == a**2+b**2:
                    cnt +=1
                    # there exists only one pair of (a, b) per c
                    break

                a -= 1

        # update stats
        if cnt > max_cnt:
            max_cnt = cnt
            max_p = p

    return max_cnt, max_p
    
if __name__ == "__main__":
    print(main())<commit_msg>Integer right triangles<commit_after>import math

def main():

    max_sum_of_two_sides = 600
    duplicate_check_list = []
    cnt_list = []

    for a in range(1, max_sum_of_two_sides):
        for b in range(1, max_sum_of_two_sides-a):
            c = math.sqrt(a**2+b**2)
            if c.is_integer():
                c = int(c)
                p = a+b+c
                if p <= 1000:
                    sorted_sides_of_triangle = sorted((a, b, c))
                    if sorted_sides_of_triangle in duplicate_check_list:
                        continue
                    else:
                        cnt_list.append(p)
                        duplicate_check_list.append(sorted_sides_of_triangle)
            else:
                continue
    
    result = dict((perimeter, cnt_list.count(perimeter)) for perimeter in set(cnt_list))
    answer = max(result, key=lambda x: result[x])    

    return answer

if __name__ == "__main__":
    print(main())
{'fraction_non_alphanumeric': 0.0928, 'fraction_numerical': 0.016533333333333334, 'mean_word_length': 1.3275434243176178, 'pattern_counts': {'":': 2, '<': 4, '<?xml version=': 0, '>': 6, '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': '5855653', 'n_tokens_mistral': 615, 'n_tokens_neox': 571, 'n_words': 155}