Traversing Arrays & Comparing Values

The heights of each building from West (left) to East (right) is given in an integer array. You have to tell which buildings will be able to see the sunset. Write a program that prints how many buildings and which buildings will be able to see the sunset, given the array.

Check it Out