According to the information given, the person wanted to withdraw 100A + B paise.
But he got 100B + A paise.
After spending 20 paise, he has double the amount he wanted to withdraw.
Hence, the equation is
2 * (100A + B) = 100B + A – 20
200A + 2B = 100B +A – 20
199A – 98B = -20
98B – 199A = 20
Now, we got one equation; but there are 2 variables. We have to apply little bit of logic over here. We know that if we interchange A & B, amount gets double. So B should be twice of A or one more than twice of A i.e. B = 2A or B = 2A+1
For all the other values, we amount achieved by reversing the figures would be way bigger than the double that is required here.
Case I : B=2A
Solving two equations simultaneously
98B – 199A = 20
B – 2A = 0
We get A = – 20/3 & B = – 40/2
Case II : B=2A+1
Solving two equations simultaneously
98B – 199a = 20
B – 2A = 1
We get A = 26 & B = 53
Now, it’s obvious that he wanted to withdraw Rs. 26.53