时间限制:C/C++ 2秒,其他语言4秒 空间限制:C/C++ 256M,其他语言512M 热度指数:49497
题解:
- set去重
- 双指针left、right标记中间段无重复字串的左右两端
- 遍历字符串,当右指针超过字符串标记位,停止遍历,每次查询一个字符后,进行判断,如果无重复,right++;若重复,消除arr【left】,left++;
class Solution {
public:
/**
*
* @param arr int整型vector the array
* @return int整型
*/