刷题 - 双指针

2020-05-07  本文已影响0人  砂壶

参考https://github.com/CyC2018/CS-Notes/blob/master/notes/Leetcode%20%E9%A2%98%E8%A7%A3%20-%20%E7%9B%AE%E5%BD%95.md

双指针部分:

https://leetcode-cn.com/problems/two-sum-ii-input-array-is-sorted/

https://leetcode-cn.com/problems/sum-of-square-numbers/
(注意双指针p取0开始,条件p<=q)

https://leetcode-cn.com/problems/reverse-vowels-of-a-string/

(注意改变字符串不会影响原值,要改成引用类型如数组)

https://leetcode-cn.com/problems/valid-palindrome-ii
(一定要注意循环终止条件)

https://leetcode-cn.com/problems/merge-sorted-array/
(条件!条件!)

https://leetcode-cn.com/problems/longest-word-in-dictionary-through-deleting/
(注意审题:字典顺序最小,可以先比较首字母小了再检查)

上一篇下一篇

猜你喜欢

热点阅读