讨论/面试考题/数组区间合并/
数组区间合并

输入一个数组如:s = ['a','b','c','h','j','x','y','z']
输出数组形式为:result = ['a-c','h','j','x-z']

展开讨论
共 1 个讨论

所以,如果 s = ['a','b','c','h','d','e','j','x','y','z']
输出的是 result = ['a-c','h','d-e','j','x-z']
还是result = ['a-e','h','j','x-z']