See Buildings Algo

function seeBuildingsLeft(buildingsArr){
  let tallestBuilding = 0
  let buildingCount = 0
  for (let buildingHeight of buildingsArr){
    if (tallestBuilding < buildingHeight){
      tallestBuilding = buildingHeight
        buildingCount += 1
    } else {
      break
    }
  }
  return buildingCount
}
Powered by Codespace