CPP || best in the world
Complexity\n- Time complexity:O(n)\n Add your time complexity here, e.g. O(n) \n\n- Space complexity:O(n)\n Add your space complexity here, e.g. O(n) \n\n# Code
# Complexity\n- Time complexity:O(n)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:O(n)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```cpp []\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* insertionSortList(ListNode* head) {\n        vector<int>v;\n        ListNode *p = head;\n        while(p!=nullptr){\n            v.push_back(p->val);\n            p=p->next;\n        }\n        sort(v.begin(),v.end());\n        p = head;\n        for(int i=0;i<v.size();i++){\n            p->val = v[i];\n            p=p->next;\n        }\n        return head;\n    }\n};\n```
['Linked List', 'Sorting', 'C++']