Advertisement
Guest User

Untitled

a guest
Jul 25th, 2014
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. 1, 3, 5, 7, 9
  2. 7, 7, 7, 7
  3. 3, -1, -5, -9
  4.  
  5. A[P], A[P+1], ..., A[-1], A[Q]
  6.  
  7. def solution(A)
  8.  
  9. A[0] = -1
  10. A[1] = 1
  11. A[2] = 3
  12. A[3] = 3
  13. A[4] = 3
  14. A[5] = 2
  15. A[6] = 1
  16. A[7] = 0
  17.  
  18. (0, 2) (2, 4) (4, 6) (4, 7) (5, 7)
  19.  
  20. N is an integer within the range [0..60,000];
  21. each element of array A is an integer within the range [−2,147,483,648..2,147,483,647].
  22.  
  23. expected worst-case time complexity is O(N);
  24. 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