C******a 发帖数: 32 | 1 考虑有相同元素情形.需要给出compact, clean code, C or C++.
Write a C++ program that print the first longest
ascending or descending contiguous substring for a vector of integers. Given
a vector
4, 2, 1, 2, 3, 4, 3, 5, 1, 2, 4, 6, 5
the program would print:
1, 2, 3, 4
算法不难,但写不出简短的clean code. 欢迎讨论. |
|