Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public ListNode deleteAtTail(ListNode head) {
- if(head == null || head.next == null) return null;
- ListNode curr = head;
- while(curr.next.next != null){
- curr = curr.next;
- }
- curr.next = null;
- return head;
- }
Advertisement
Add Comment
Please, Sign In to add comment