第二题的话,双指针维护一个区间[i, j],当区间内满足 max_num - min_num == j - i,更新返回值 res = max(res, j - i + 1)
1 6

相关推荐

牛客网
牛客网在线编程
牛客网题解
牛客企业服务