trapping-rain-water 1.0.0
Trapping Rain Water
Loading...
Searching...
No Matches
main.cpp File Reference
#include <iostream>
#include <vector>
Include dependency graph for main.cpp:

Go to the source code of this file.

Data Structures

class  Solution
 

Functions

int main ()
 

Function Documentation

◆ main()

int main ( )

Definition at line 41 of file main.cpp.

42{
43 vector<int> terrain = {1,3,2,4,1,3,1,4,5,2,2,1,4,2,2}; // expected 15
44 // vector<int> terrain = {0,1,0,2,1,0,1,3,2,1,2,1}; // expected 6
45 // vector<int> terrain = {4,2,0,3,2,5}; // expected 9
46 Solution sol;
47 cout << "Volume of the lakes: " << sol.trap(terrain) << endl;
48 return 0;
49}
int trap(vector< int > &height)
Definition main.cpp:9

References Solution::trap().