C ++ program to find maximum amount of water that can be trapped within given set of bars . Space Complexity : O ( 1 )
#include <iostream> NEW_LINE using namespace std ; int findWater ( int arr [ ] , int n ) {