document.getElementById("submit-btn").addEventListener("click", function () {
DoSunsetHills()
});
function ClearAll() {
document.getElementById("Input1").value = "";
document.getElementById("Input2").value = "";
document.getElementById("Input3").value = "";
document.getElementById("Input4").value = "";
document.getElementById("Input5").value = "";
document.getElementById("SeeSunset").innerText = "";
}
function DoSunsetHills() {
let height1 = parseInt(document.getElementById("Input1").value);
let height2 = parseInt(document.getElementById("Input2").value);
let height3 = parseInt(document.getElementById("Input3").value);
let height4 = parseInt(document.getElementById("Input4").value);
let height5 = parseInt(document.getElementById("Input5").value);
let heightArray = [height1, height2, height3, height4, height5];
let newArray = [];
let count = 1;
let currMax = heightArray[0];
newArray.push(currMax);
for (let i = 1; i < heightArray.length; i++) {
if (heightArray[i] > currMax) {
newArray.push(heightArray[i]);
count++;
currMax = heightArray[i];
}
}
document.getElementById("SeeSunset").innerHTML = `${count} See Sunset: [${newArray}]`;
};