#include #include #include #include #include using namespace std; int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ //Input int N; //Number of steps string height; //Amount above sea level vector heights {0}; //I'm going to store my heights above sea level here cin >> N; string U = "U"; for (int i=0; i> height; if (height[i] == U[0]) { heights.push_back(heights[i]+1); } else { heights.push_back(heights[i]-1); } } //Algorithm - number of valleys = number of -1s divided by 2 lol. WHOOPS FAIL. //number of valleys = number of -1's followed by 0's etc. int valleyNumber = 0; bool valleyStarted = false; for (int i=0; i