摘要:
19. Remove Nth Node From End of List 题目 解析 两种思路 思路一:第一遍遍历得到链表的长度,第二遍走cnt n步,注意边界条件 思路二:两个指针,第一个先走n 1步,然后两个指针一起走 题目来源 "19. Remove Nth Node From End of 阅读全文
摘要:
"欢迎fork and star:Nowcoder Repository github" 18. 4Sum 题目 解析 C++ class Solution_18 { public: vector fourSum(vector& nums, int target) { vector vecs; if 阅读全文
摘要:
"欢迎fork and star:Nowcoder Repository github" 17. Letter Combinations of a Phone Number 题目 解析 可以迭代,即依次读取字符串中的每位数字,然后把数字对应的字母依次加到当前的所有结果中,然后进入下一次迭代。也可以用 阅读全文