<commit_before>#include <iostream>

using namespace std;

struct ListNode
{
	int val;
	ListNode *next;
	ListNode(int x):val(x),next(NULL)
	{
	}
};

class Solution
{
public:
	ListNode *deleteDuplicates(ListNode *head)
	{
		if(head == NULL || head->next == NULL)
			return head;
		ListNode *curNode = head;
		while(curNode != NULL && curNode->next != NULL)
		{
			if(curNode->val == curNode->next->val)
			{
				ListNode *nextNode = curNode->next;
				curNode->next = nextNode->next;
				delete nextNode;
			}
			else
			{
				curNode = curNode->next;
			}	
		}
		return head;
	}
};

int main()
{
	Solution solution;
	ListNode *head = new ListNode(1);
	head->next = new ListNode(1);
	head->next->next = new ListNode(2);
	head = solution.deleteDuplicates(head);

	while(head != NULL)
	{
		cout << head->val << " ";
		head = head->next;
	}
	cout << endl;

	ListNode *head2 = new ListNode(1);
	head2->next = new ListNode(1);
	head2->next->next = new ListNode(2);
	head2->next->next->next = new ListNode(3);
	head2->next->next->next->next = new ListNode(3);
	head2 = solution.deleteDuplicates(head2);

	while(head2 != NULL)
	{
		cout << head2->val << " ";
		head2 = head2->next;
	}
	cout << endl;

	return 0;
}
<commit_msg>排序链表删除数据<commit_after>#include <iostream>

using namespace std;

struct ListNode
{
	int val;
	ListNode *next;
	ListNode(int x):val(x),next(NULL)
	{
	}
};

class Solution
{
public:
	ListNode *deleteDuplicates(ListNode *head)
	{
		if(head == NULL || head->next == NULL)
			return head;
		ListNode *curNode = head;
		while(curNode != NULL && curNode->next != NULL)
		{
			if(curNode->val == curNode->next->val)
			{
				ListNode *nextNode = curNode->next;
				curNode->next = nextNode->next;
				delete nextNode;
			}
			else
			{
				curNode = curNode->next;
			}	
		}
		return head;
	}
};

int main()
{
	Solution solution;
	ListNode *head = new ListNode(1);
	head->next = new ListNode(1);
	head->next->next = new ListNode(2);
	head = solution.deleteDuplicates(head);

	while(head != NULL)
	{
		cout << head->val << " ";
		head = head->next;
	}
	cout << endl;

	ListNode *head2 = new ListNode(1);
	head2->next = new ListNode(1);
	head2->next->next = new ListNode(2);
	head2->next->next->next = new ListNode(3);
	head2->next->next->next->next = new ListNode(3);
	head2 = solution.deleteDuplicates(head2);

	while(head2 != NULL)
	{
		cout << head2->val << " ";
		head2 = head2->next;
	}
	cout << endl;

	return 0;
	
}

{'fraction_non_alphanumeric': 0.17276840806252572, 'fraction_numerical': 0.016454134101192924, 'mean_word_length': 3.397830018083183, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 57, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6065099', 'n_tokens_mistral': 1031, 'n_tokens_neox': 949, 'n_words': 196}