There are some edge cases, like 3:00 3:00 or 9:00 9:00, for which the answer is 1 and not 0.

It’s all mentioned clearly in the editorial.

[UPD]: My Submission

Hi, @codedirector, I’m the setter for this question and as @aneee004 correctly pointed out, your solution seems to be failing for the case 3,3

2 Likes

brother let take example

l=1,r=4;

from time 1 to 2 =+2

from 2 to 3 =+2

as you for every 3 or 9

from 3 to 4=+3

sum=7;

and for every 3 multiple it will -1

sum=7-1;

sum=6;

while your code gives output as 6;

Hi, @codedirector, if you read the editorial carefully I wrote thrice per two hours for the case of 3.

So,

1-2 - twice

2-4 - thrice

Therfore answer will be 5

ohh okkk now got it.