leetcode
leetcode copied to clipboard
Leetcode solutions
https://github.com/neetcode-gh/leetcode/blob/85d1f52d350efc88b3d8f53c973bfe47a97f4dc5/cpp/0021-merge-two-sorted-lists.cpp#L35-L42C1 there's code reuse here. I'd suggest creating a new node, which will be the dummy, and returning head->next, like this: ``` ListNode* dummy = new ListNode(); ListNode* curr =...
[//]: # "Pull Request Template" [//]: # "Replace the placeholder values in the template below" - **File(s) Modified**: 0021-merge-two-sorted-lists.cpp - **Language(s) Used**:cpp - **Submission URL**: _https://leetcode.com/problems/[problem-name]/submissions/xxxxxxxxx/_ [//]: # "Getting the...
[//]: # "Pull Request Template" [//]: # "Replace the placeholder values in the template below" - **File(s) Modified**: _0001-two-sum.py, 0002-add-two-numbers.py, etc..._ - **Language(s) Used**: _python, javascript, etc..._ - **Submission URL**:...
[//]: # "Pull Request Template" [//]: # "Replace the placeholder values in the template below" - **File(s) Modified**: 0901-online-stock-span.cpp - **Language(s) Used**: C++ - **Submission URL**:https://leetcode.com/problems/online-stock-span/submissions/958495331/ [//]: # "Getting the...
[//]: # "Pull Request Template" [//]: # "Replace the placeholder values in the template below" - **File(s) Modified**: 0735-asteroid-collision.cpp - **Language(s) Used**: C++ - **Submission URL**: https://leetcode.com/problems/asteroid-collision/submissions/958466174/ [//]: # "Getting...
- **File(s) Modified**: _0402-remove-k-digits.py_ - **Language(s) Used**: _python_ - **Submission URL**: _https://leetcode.com/problems/remove-k-digits/submissions/958238461/_ ### Important Please make sure the file name is lowercase and a duplicate file does not already exist...
Solution for the LeetCode question 450 in Java [//]: # "Pull Request Template" [//]: # "Replace the placeholder values in the template below" - **File(s) Modified**: 0450-delete-node-in-a-bst.java - **Language(s) Used**:...
[//]: # "Pull Request Template" [//]: # "Replace the placeholder values in the template below" - **File(s) Modified**: remove-duplicates-from-sorted-array-ii.js - **Language(s) Used**: javascript - **Submission URL**: https://leetcode.com/problems/remove-duplicates-from-sorted-array-ii/submissions/957913515/ [//]: # "Getting...
File(s) Modified: 0343-integer-break.py Language(s) Used: python Submission URL: https://leetcode.com/problems/integer-break/submissions/955194149/
- **File(s) Modified**: _0785-is-graph-bipartite.java, 0912-sort-an-array.java, 2130-maximum-twin-sum-of-a-linked-list.java, 2544-alternating-digit-sum.java_ - **Language(s) Used**: _java_ - **Submission URL**: _https://leetcode.com/problems/is-graph-bipartite/submissions/953464058/_