diff --git a/binary_search.cpp b/binary_search.cpp new file mode 100644 index 0000000..a3fa9d3 --- /dev/null +++ b/binary_search.cpp @@ -0,0 +1,21 @@ +int maxArea(vector& height) { + int low = 0; + int high = height.size()-1; + int largest = 0; + while(lowlargest){ + largest = area; + } + if(height[low]>height[high]){ + high--; + } + else{ + low++; + } + } + return largest; +} +};