The code discussed in the video, giving wrong results

I tried to replicate this code and try to run on my ide the testcases given in the problem, this code is giving wrong results. Please look to it,
here is my code :

The problem you are getting issue is in Inclusion Exclusion Concept + Implementation video? Moreover, please describe your problem in brief too.

trying to solve this problem https://hack.codingblocks.com/app/practice/1/1264/problem

With the code mentioned above, (not able to clear test case)

The logic you have used is right, it’s just wrong formatting in for loop. Have a look at this .

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.