Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1, 3, 5, 7, 9
- 7, 7, 7, 7
- 3, -1, -5, -9
- A[P], A[P+1], ..., A[-1], A[Q]
- def solution(A)
- A[0] = -1
- A[1] = 1
- A[2] = 3
- A[3] = 3
- A[4] = 3
- A[5] = 2
- A[6] = 1
- A[7] = 0
- (0, 2) (2, 4) (4, 6) (4, 7) (5, 7)
- N is an integer within the range [0..60,000];
- each element of array A is an integer within the range [−2,147,483,648..2,147,483,647].
- expected worst-case time complexity is O(N);
- expected worst-case space complexity is O(N), beyond input storage (not counting the storage required for input arguments).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement