Ll - kreverse doubt

i have applied brute force but i am not getting correct output …can someone suggest changes in this code ?

Aayush, plz refer to the online video hint given for this question under the section of linked list.