Skip to content

Instantly share code, notes, and snippets.

View KDJDEV's full-sized avatar

Kyle KDJDEV

View GitHub Profile
@KDJDEV
KDJDEV / test.py
Created September 26, 2023 16:39
Test that my solution works for the first 100 n for the question "If you had n line segments with lengths that correspond to the first n natural numbers, how many unique triangles could you make?"
import itertools
def true_result(n):
natural_numbers = []
for i in range(1, n + 1):
natural_numbers.append(i)
combinations = list(itertools.combinations(natural_numbers, 3))
count = 0
{"RAPtoValue": {"10000": 13000, "8600": 11000, "17000": 22000, "21500": 28000, "4700": 6000, "4000": 5000, "12400": 16000, "27000": 35000, "37000": 48000, "18500": 24000, "9400": 12000, "6200": 8000, "11600": 15000, "7800": 10000, "25000": 32000, "14000": 18000, "31000": 40000, "20000": 26000, "7000": 9000, "15500": 20000, "29000": 38000, "5400": 7000, "35000": 45000, "23000": 30000, "40000": 50000, "33000": 42000, "10800": 14000}, "rblx": {"55620437": 4289, "5785985": 3622, "49491781": 3695, "6803402872": 16798, "10159610478": 1395, "76692739": 841, "121260372": 9084, "277859296": 3107, "445117183": 4152, "58438853": 32000, "108158379": 320000, "18015836": 48935, "130106618": 7245, "121925071": 3389, "60115663": 6213, "22151828": 6436, "1743932756": 24000, "53920070": 4970, "69486761": 6507, "16598538": 7066, "130213380": 42000, "51245193": 5051, "23301644": 6004, "8763364938": 525, "878908562": 230000, "1230403652": 3621, "148816890": 3293, "64496525": 7764, "62720331": 1218, "1213428661": 2578, "192557792"