reverse linked list and two subset problems