code:
Testcase 1 and 2 showing run error :
hey @myself.yash.srivastav, your code is giving runtime error for testcases like this
1
0
1
0
I suggest you to correct your approach, there is no need of reversing the linked list. Just traversed the bigger linked list d times where d=abs(n-m). After that size of LL become equal and now check each element of both list to be equal or not.