ABC Interview Question

Linked list related sorting problem