Skip to content

Latest commit

 

History

History
7 lines (7 loc) · 466 Bytes

File metadata and controls

7 lines (7 loc) · 466 Bytes
  • Type: Two pointers
  • Approach:
    • Set two pointers as 0 and max value, if the value of function equal to z, add 2 pointers to the result; if the value of function larger than z, shrink the value of bigger pointer; otherwise, make the value of smaller pointer larger.
  • Complexity:
    • Time: O(n)
    • Space: O(n)