🐶双指针
相当于将两个链表连在一起,一条是A + B, 一条是B + A,走过同样的长度。
1 | class Solution { |
🚌set实现
1 | class Solution { |
Accepted
16/16 cases passed (36 ms)
Your runtime beats 6.15 % of cpp submissions
Your memory usage beats 5.56 % of cpp submissions (12.1 MB)
相当于将两个链表连在一起,一条是A + B, 一条是B + A,走过同样的长度。
1 | class Solution { |
1 | class Solution { |
Accepted
16/16 cases passed (36 ms)
Your runtime beats 6.15 % of cpp submissions
Your memory usage beats 5.56 % of cpp submissions (12.1 MB)