Doubt in # of Multiples in Interval

Hello everyone! This question is from Prep swift # of Multiples in Interval Exercise. I had a basic doubt.
image
Let’s say I get my b=219, do I need to consider the 2nd value after 219, which will be 221? Because 85 is not a multiple of 3, therefore we take 87 as our first multiple, which is the ‘2nd value’ after 85.
So, is this the reason why we considered 221, as it is also the 2nd value after 219? As 219 is a multiple of 3, and we want the inclusive value. Is my understanding correct?

b can either be 219, 220, or 221 because you have 45 multiples of 3 for all those values. The question asks for the largest value that b can attain, so you’d choose the max, which clearly happens to be 221.

1 Like