Easy C++ solution
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\nIterate through the list while counting the frequency of every element. I
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\nIterate through the list while counting the frequency of every element. If the frequency of the element is one then we add the element to the list.\n\nTo do this take a previous pointer and point it to NULL. Take a temporary pointer to iterate though the list. Count the frequency of every element. If the frequency is one, point the prevoius Node to the current Node and initialize the privious node to the current Node. But if the previous node is NULL, then initialize head pointer to the current Node and previous Node to also the current node. When temp reaches to NULL and previous node is not NULL then point the Previous Node to NULL.\n\nBut if the prevoius node is still is NULL it means the list has no value of single frequency. In this case return NULL.\n\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity: $$O(n)$$ Cause the list is iterated only once. \n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity $$O(1)$$ We only use constant size variables\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\n/**\n * Definition for singly-linked list.\n * struct ListNode {\n *     int val;\n *     ListNode *next;\n *     ListNode() : val(0), next(nullptr) {}\n *     ListNode(int x) : val(x), next(nullptr) {}\n *     ListNode(int x, ListNode *next) : val(x), next(next) {}\n * };\n */\nclass Solution {\npublic:\n    ListNode* deleteDuplicates(ListNode* head) {\n\n        ListNode* temp = head;//Temporary pointer\n        ListNode* pre = NULL;//Initializing previous pointer to NULL\n        \n        /* Looping through the list untill the tempurary pointer\n        reaches NULL */  \n        while(temp != NULL){\n\n            int k = 1;\n            ListNode* curr = temp; //Initialize current pointer to temp\n            \n            //Counting the frequency of the current element\n            while((temp != NULL) && (temp->val == curr->val)){\n                temp = temp->next;\n                k++;\n            }\n            k--;\n\n            //If frequency of the element is 1 put it in the the list\n            if(k == 1){\n\n                // If the previous pointer is null then initialize\n                // the head pointer  and the previous pointer \n                // to the current pointer\n  \n                if(pre == NULL){\n                    head = curr;\n                    pre = curr;\n                }\n\n                //if not then previous to current and next value of\n                // privious pointer to current pointer\n                else{\n                    pre->next = curr;\n                    pre = curr;\n                }\n            }\n            // when temporary pointer reaches to NULL\n            // and prevoius pointer is not null then initialie\n            // next value of prevoius pointer to NULL or temp\n\n            if(temp == NULL && pre != NULL){\n                pre->next = temp;\n            }\n        } \n\n        // If prevoius pointer is still is NULL, it means that \n        // no value is eligible for the ans list\n        // so initialize head to NULL and return head\n\n        if(pre == NULL){\n            head = NULL;\n        }\n        return head;\n    }\n};\n```
['Linked List', 'C++']