For example, consider Array A such that: A[1, 3, 2, 1, 2, 1, 5, 3, 3, 4, 2]
https://i.imgur.com/Ol2ncvm.png
You would like to paint the skyline using continuous horizontal brushstrokes. Every horizontal stroke is one unit high and arbitrarily wide. The goal is to calculater the minimum number of horizontal strokes needed. For example, the above shape can be painted using 9 horizontal strokes