I have written the same code but its giving me an runtime error exception stating that in while loop line its Getting a NULL POINTER Exception.Below is my code class Solution { public ListNode deleteDuplicates(ListNode head) { if(head==null || head.next==null){ return head; } ListNode temp=head; while(temp.next!=null){
@sakshamsinha17634 ай бұрын
hmlog node ko delete kyu ni krte pls tell me
@CodingWithPrakash_4 ай бұрын
Java will automatically remove unused object by its property of garbage collection We can just unlink node and we are good to go