whats the error in my codes
Not so easy maths
@drishti307 Your code runs in O(n) here n is of the order 18 so this will not work.
This question is based on the principal of inclusion and exclusion.
https://www.youtube.com/watch?v=tMRZ6gqFYdg
Here is a video of Prateek sir discussing the principle of inclusion and exclusion using same kind of problem
If this resolves your doubt mark it resolved.
thank you very much for the help