Intuitive solution and similar problem
1578. Minimum Time to Make Rope Colorful\n83. Remove Duplicates from Sorted List\n82. Remove Duplicates from Sorted List II\n\n\n# Code\njava []\n\nclass Soluti
[1578. Minimum Time to Make Rope Colorful](https://leetcode.com/problems/minimum-time-to-make-rope-colorful/solutions/5539730/most-intuitive-problem-easy-accepted/)\n[83. Remove Duplicates from Sorted List](https://leetcode.com/problems/remove-duplicates-from-sorted-list/solutions/5539733/interview-accepted-easy-solution/)\n[82. Remove Duplicates from Sorted List II](https://leetcode.com/problems/remove-duplicates-from-sorted-list-ii/solutions/5539719/intuitive-solution-and-similar-problem/)\n\n\n# Code\n```java []\n\nclass Solution {\n    public ListNode deleteDuplicates(ListNode head) {\n\n        if (head == null || head.next== null) return head;\n\n        ListNode dummyHead = new ListNode(0,head);\n        ListNode prev = dummyHead;\n\n        ListNode current = head;\n\n        while (current!=null){\n\n            if(current.next!=null && current.val==current.next.val){\n                while(current.next!=null && current.val == current.next.val){\n                    current = current.next;\n                }\n                prev.next= current.next;\n            }\n            else{\n                prev=prev.next;\n            }\n            current = current.next;\n        }\n        return dummyHead.next;\n        \n    }\n}\n```\n\n
['Java']