Amazon interview question

https://www.geeksforgeeks.org/number-buildings-facing-sun/