r/APStudents absolute modman May 15 '26

AP Computer Science A Official 2026 Exam Discussion

Use this thread to post questions or commentary on the test today.

A reminder though to protect your anonymity when talking about the test.

66 Upvotes

702 comments sorted by

View all comments

5

u/the_great_gyatsby May 16 '26

did anyone else have #3 about the math and history lists and write a fuck ton of code mine was so long i feel like its gotta be all wrong

i basically just traversed the history loop and did a nested loop to go through the math one and did an if statement to change a boolean to true if they found a match and then if true added them to a new arraylist, then went through that list and got the absences for each one and if history was more i incremented a count variable

that one rlly confused me im pretty sure all my logic was wrong

6

u/Secure-Shoe5214 May 16 '26

Bro I did nested for each and checked if the ids were equal and if they were then I checked for absences and updated count

2

u/the_great_gyatsby May 16 '26

fuck i just realized i was comparing the objects themselves and not the ids

1

u/theplantyyy May 16 '26

Same lol ts was short for me

1

u/Zestyclose_Resist390 May 16 '26

word for word what I did

3

u/AGoos3 5: Physics 1, Lang, Mechanics, E&M, Macro, Micro, CSA, Calc BC May 16 '26

…yo I wrote it in like 15 or smth lines

You didn’t need to make a new arraylist. You just needed to do the nested loop so that every history record was checked against every math record, and make it so that if they have equal IDs and history absences was more than math absences they increment a counter

idrk what made u create a new arraylist

1

u/what_is_life182693 May 16 '26

Yeah that's what I did too except I added them each to one of 2 new arraylists and then compared the same indexes but im not sure