饶毅做外交部部长如何?# Biology - 生物学
h*o
1 楼
Input:
1. an array of characters
2. a bunch of scores, for each
a. start (start position in the array)
b. end (end position in the array)
c. score (score is not related to the content of the substring or
length of the substring)
Scores could be overlapped.
Output:
all scores (there is no overlap on them) that have the maximum sum.
For example
Input:
"abcdedfhijk"
start: 1 end: 3 score: 5
start: 0 end: 10 score: 8
start: 5 end:6 score 4
Output:
start: 1 end: 3 score: 5
start: 5 end:6 score 4
Provide algorithm which is not brute force.
1. an array of characters
2. a bunch of scores, for each
a. start (start position in the array)
b. end (end position in the array)
c. score (score is not related to the content of the substring or
length of the substring)
Scores could be overlapped.
Output:
all scores (there is no overlap on them) that have the maximum sum.
For example
Input:
"abcdedfhijk"
start: 1 end: 3 score: 5
start: 0 end: 10 score: 8
start: 5 end:6 score 4
Output:
start: 1 end: 3 score: 5
start: 5 end:6 score 4
Provide algorithm which is not brute force.