1. 字符串
3.无重复字符的最长子串
https://leetcode-cn.com/problems/longest-substring-without-repeating-characters/
5. 最大回文子串
链接:https://leetcode-cn.com/problems/longest-palindromic-substring/solution/zui-chang-hui-wen-zi-chuan-by-leetcode-solution/
利用动态规划或者直接双重便利,时间复杂度O(n^2)
6. Z形变换
https://leetcode-cn.com/problems/zigzag-conversion/
发现规律:每一行的字符之间的距离是有规律,第一行和最后一行每个字符之间距离(L= (numRows - 2) * 2 + 2),中间的每一行距离在两个值之间变动,L - 2 * i,和2i.
其他
4. 寻找两个正序数组的中位数
解法:https://blog.youkuaiyun.com/qq_44606649/article/details/122408540
7. 整数反转
https://leetcode-cn.com/problems/reverse-integer/
优解:https://leetcode-cn.com/problems/reverse-integer/solution/tu-jie-7-zheng-shu-fan-zhuan-by-wang_ni_ma/
- 不必转换字符串,可以利用除和余来进行反转,
- 至于阈值判断,只需要判断数字长度是否等于MaxValue的长度即可
- 如果小于,那么直接反转
- 否则,只需要在每反转一位后判断是否大于MaxValue前n位即可