Question: Count the number of times a depth measurement increases from the previous measurement. (There is no measurement before the first measurement.)
Answer: I decided to solve it without using arrays and using two variables which holds the latest two measurements.
Question: Find horizontal position and depth of the submarine. The input file contains directions.
Answer: Multiply horizontal position and depth value.