✅99% BEATS 🔥 RECURSION and BINARY SEARCH 🤠
Proof \uD83D\uDC68\u200D\uD83C\uDFEB\n\n\n\n---\n\n# Easy as fuck \uD83D\uDE14\uD83E\uDD1E\n\n# Code\ncpp []\n\nclass Solution {\nprivate:\n    std::vector<int>
# Proof \uD83D\uDC68\u200D\uD83C\uDFEB\n![proof](https://assets.leetcode.com/users/images/b168fd8a-f366-4e4d-a7b0-89cc3b1b7098_1725583941.9600124.png)\n\n\n---\n\n# Easy as fuck \uD83D\uDE14\uD83E\uDD1E\n\n# Code\n```cpp []\n\nclass Solution {\nprivate:\n    std::vector<int> sorted_nums;\n    ListNode* DeleteNodes(ListNode* cur)\n    {\n        if(cur == nullptr) return cur; // this way is more READABLE fr\n        cur->next = DeleteNodes(cur->next);\n        if(std::binary_search(sorted_nums.begin(), sorted_nums.end(), cur->val)){\n            return cur->next;\n        }\n        else{\n            return cur;\n        }\n    }\npublic:\n    ListNode* modifiedList(std::vector<int>& nums, ListNode* head) {\n        sorted_nums = nums;\n        std::sort(sorted_nums.begin(), sorted_nums.end());\n        return DeleteNodes(head);\n    }\n};\n\nauto init = []() {\n    std::ios::sync_with_stdio(0);\n    std::cin.tie(0);\n    std::cout.tie(0);\n    return \'c\';\n}();\n```\n> If u need any help, just write in the comment section.\n\n\n![adamgrabowiecki](https://assets.leetcode.com/users/images/1cf74974-792d-4808-8e5c-d9b64c25c558_1725584305.9138362.png)\n\n
['C++']