Leetcode Array

C++

Posted by PZ on March 4, 2020
  • array 连续值
  • array 双指针
  • array 排序去除
  • array 从两边夹向中间 product of array except self
  • array 从中间向两边散开 Longest - Palindromic Substring
  • array也可以倒着考虑,从后往前 –》 merge sorted aray

Sliding windows: 固定一个增加(++),另一个不定增加

img

img

Spreading from the center

img

Try all possible i and find the longest palindromic string whose center is i (odd case) and i / i + 1 (even case).