A mountain is a list with exactly one peak.
A valley is a list with exactly one trough.
Some examples of mountains and valleys:
Mountain A: [1, 3, 5, 4, 3, 2] # 5 is the peak
Mountain B: [-1, 0, -1] # 0 is the peak
Mountain B: [-1, -1, 0, -1, -1] # 0 is the peak (plateau on both sides is okay)
Valley A: [10, 9, 8, 7, 2, 3, 4, 5] # 2 is the trough
Valley B: [350, 100, 200, 400, 700] # 100 is the trough
Neither mountains nor valleys:
Landscape A: [1, 2, 3, 2, 4, 1] # 2 peaks (3, 4), not 1
Landscape B: [5, 4, 3, 2, 1] # Peak cannot be a boundary element
Landscape B: [0, -1, -1, 0, -1, -1] # 2 peaks (0)
Based on the rules above, write a function that takes in a list and returns either "mountain", "valley", or "neither".
landscape_type([3, 4, 5, 4, 3]) ➞ "mountain"
landscape_type([9, 7, 3, 1, 2, 4]) ➞ "valley"
landscape_type([9, 8, 9]) ➞ "valley"
landscape_type([9, 8, 9, 8]) ➞ "neither"