6 days ago
Thanks for your feedback Udochukwupatrick ! You're right—list.size() is constant for ArrayList, but for linked lists or other dynamic collections, it can be an expensive call. It’s always good to be mindful of the data structure in use. Appreciate the discussion Udochukwupatrick!