SMPAIR (The Smallest Pair) : Partial correct answer

My code is not getting accepted for 3 of the 4 sub task! Please put some light on this subject! What is getting wrong in the above sub task(s)? Any test case? or anything? Thank you!

link to question
link to solution