text: #
  # @lc app=leetcode id=83 lang=python3
  #
  # [83] Remove Duplicates from Sorted List
  #
  # https://leetcode.com/problems/remove-duplicates-from-sorted-list/description/
  #
  # algorithms
  # Easy (43.71%)
  # Likes:    996
  # Dislikes: 88
  # Total Accepted:    383.5K
  # Total Submissions: 876.4K
  # Testcase Example:  '[1,1,2]'
  #
  # Given a sorted linked list, delete all duplicates such that each element
  # appear only once.
  # 
  # Example 1:
  # 
  # 
  # Input: 1->1->2
  # Output: 1->2
  # 
  # 
  # Example 2:
  # 
  # 
  # Input: 1->1->2->3->3
  # Output: 1->2->3
  # 
  # 
  #
  
  # @lc code=start
  # Definition for singly-linked list.
  # class ListNode:
  #     def __init__(self, x):
  #         self.val = x
  #         self.next = None
  class Solution:
      def deleteDuplicates(self, head: ListNode) -> ListNode:
          temp = head
          while temp is not None and temp.next is not None:
              if temp.val==temp.next.val:
                  temp.next = temp.next.next
              else:
                  temp = temp.next
          return head
  # @lc code=end
  
  