Passing all the sample test cases but says wrong answer after submission

problem statement : https://www.spoj.com/problems/BLHETA/

my code : https://ide.codingblocks.com/s/214410

can i make my comparator with just one function?

Hi @prateek_5

I have corrected your code. You will be able to figure out the changes.
Link : https://ide.codingblocks.com/s/214698

Hope it Helps.

says wrong answer on submission.

Can you please post the screenshot of the submission page as i do not have access to spoj.

it says nothing but ‘wrong Answer’.

As in doesn’t show the number of test cases or the test case on which it went wrong like in codeforces?

it just shows wrong answer and no other details whatsoever.
why don’t you try signing up?

Ok. Will get back to you after testing on it.