Segmentation fault on spoj

code here

In your comp function you are not returning any thing in case if condition is fails.

thanks wasted a lot of time regarding this

@Akshay0404 if your doubt is resolved mark it as resolved.