Background
The Sunset Hills coding challenge is intended to assess a candidate’s ability to work with Arrays. This challenge or a slight variation has been used by technology companies such as Amazon and was also featured on a Geeks for Geeks blog post titled “Amazon Interview Experience | Set 189 (For SDE-1)”
Description
An array of buildings is facing the sun. The heights of each building from West to East 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 [3, 2, 4, 7, 6, 9]. The output should look something like this:4 --> [3, 4, 7, 9]
Allow the user to enter their own values into an array before determining who can see the Sunset.
Solve
Code
The following is my Java-script code used for this exercise. Read over if your interested.
Technologies
Technologies Used: HTML, CSS, JavaScript, jQuery and Bootstrap. Made in VS Studio 2019 with code on GitHub.