Due to an immense rise in Pollution, Kejriwal is back with the Odd and Even Rule in Delhi. The scheme is as follows, each car will be allowed to run on Sunday if the sum of digits which are even is divisible by 4 or sum of digits which are odd in that number is divisible by 3. However to check every car for the above criteria can’t be done by the Delhi Police. You need to help Delhi Police by finding out if a car numbered N will be allowed to run on Sunday?
IN this question there is an example where input is 12345 and answer is yes but:
4+2 is not divisible by 4
Doubt in sample input
Hi @Gautampriyadarshi
I got your point but read the question carefully, it is mentioned that the car will be allowed if the sum of digits which are even is divisible by 4 or sum of digits which are odd in that number is divisible by 3 and when input is 12345 then 2+4 is not divisible by 4 but here 1+3+5=9 is divisible by 3 hence the ans is yes.
yes i didn’t see or I thought and .
1 Like