We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3d35058 commit a618066Copy full SHA for a618066
Linked_List/2046.Sort-Linked-List-Already-Sorted-Using-Absolute-Values/Readme.md
@@ -0,0 +1,5 @@
1
+### 2046.Sort-Linked-List-Already-Sorted-Using-Absolute-Values
2
+
3
+本题的突破点在于,我们可以发现所有的正数都是从小到大排列的,所有的负数也是从大到小排列的。我们把所有的正数、负数节点分别拿出来组成两个链表,显然只需要把负数链表反转再接上正数链表就是答案了。
4
5
+这种“按照绝对值升序排列”的序列有很多有意思的题目。比如说,在这样的一个数组里,能否用o(N)的时间判断是否存在two sum等于target。
0 commit comments