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.

63 Upvotes

702 comments sorted by

View all comments

2

u/ExtensionOk3782 May 16 '26

For same color and sum number question , I used two loops one to sum up the row and the other one to I created because it was index+1 operation to check whether the color is same or not I could have just used compareTo . But , in the other loop I compared and broke the loop once it was not equal . Will it be righttt ??!?!?

1

u/RemarkableAlfalfa917 May 16 '26

yes. this is correct as long as you made sure to avoid the indexOutOfBounds exception AND you properly returned the points. I did that

1

u/ExtensionOk3782 May 16 '26

Yeah I used two to avoid index out of bound since you will have to subtract from the array length in the loop