adventofcode.com/ >Advent of Code is a series of small programming puzzles for a variety of skill levels. They are self-contained and are just as appropriate for an expert who wants to stay sharp as they are for a beginner who is just learning to code. Each puzzle calls upon different skills and has two parts that build on a theme. You need to register with an account but you can appear as anonymous.
Private leaderboard join code: 368748-e33dcae3 People who are inactive for 5 days will be kicked, but other leaderboards can be made if desired.
func partTwo(_ input: [String]) { let inputFixed = input.map { Int(String($0)) ?? 0 } var already_seen = Set() var freq = 0 var found_repeat = false while !found_repeat { for val in inputFixed { freq += val let (insertWasSuccessful, insertedValue) = already_seen.insert(freq) if !insertWasSuccessful { print(insertedValue) found_repeat = !insertWasSuccessful break } } } }
partTwo(input)
Nicholas Carter
You should choke on a dick.
John Barnes
LITERALLY SEE THE OP IMAGE YOU DROOLING RETARD
Josiah Parker
look at the OP picture you nigger.
Zachary Brooks
>mixing camel case and snake case That's what I get for "porting" my C++ solution I guess.
Cooper Wright
Nah, algos book much more represents the current situation.
tfw this is only point in the year where I am motivated to learn to code shit I don't even browse chans anymore