class Solution {
public:
ListNode* sortList(ListNode* head) {
if(!head)return head;
multisetm;
auto h1=head;
while(h1){
m.insert(h1->val);
h1=h1->next;
}
h1=head;
auto it=m.begin();
while(h1){
h1->val=*it;
it++;
h1=h1->next;
}
return head;
}
};



