Sunset Hills

A palindrome is a word, number, phrase, or other sequence of characters which reads the same backward as forward, such as madam, racecar. There are also numeric palindromes, including date/time stamps using short digits 11/11/11 11:11 and long digits 02/02/2020


Challenge 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]

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)”


Technologies Used for Sunset Hills

HTML, JavaScript, jQuery, CSS, Bootstrap

Extra Credit

Allow the user to enter their own values into an array before determining who can see the Sunset.