geting similar problems again and again

This is my code for problem:LTM40AB

please see why this is giving wrong answer


1 1 1 1
1 2 3 4
Your Output
Judge's Verdict
OK. 2 Integers found '0' and '4'

But see this-

Input 2
1 1 1 2
1 2 3 4
Your Output
Expected Output
Jury's Verdict
WRONG ANSWER. Expected "1" "4" . Found "1" "5"

You forgot to reset your “count” variable :stuck_out_tongue:

1 Like

I suppose you have started coding recently.

The Question is easy and dont panic

What you have to do: Given integers a, b, c, d find the number of integer solutions of inequality x < y, where a ≤ x ≤ b and c ≤ y ≤ d.

How to do: Iterate through all possible values of x and for each one, count the number of valid values of y to pair with it.

P.S. - Remember this also as you have just started… if your code is right and you are having problem with WA then may be its the fault of python3.5, try submitting it in python2.7.

for you reference (same code submitted in python2.7 but not in python3.5) click here

Happy Coding

1 Like
then may be its the fault of python3.5,

What does this mean?

yes I have started recently…I will keep your suggestions in mind…

Thanks…Now, I found where I was wrong

@vijju123 see this :

same(exactly same code) only input and output pattern is different

one(2.7) is giving AC and other(3.5) is giving WA

see my last 2 submissions,,goyal_banna