Question: Given a list of positive integers determine if there is an element that is either greater than its two neighbors or less than its two neighbors (a "bump"). To be clear a bump can never be the first or last item of the list because they only have one neighbor.

Your program should output one of two consistent values each corresponding to either a list with no bumps or a list with bumps. What the values are is unimportant you may choose them yourself.

This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'") so answers will be scored in bytes with fewer bytes being better.

Test cases
----------

```
[] -> False
[1] -> False
[1,2] -> False
[1,2,1] -> True
[1,2,2] -> False
[1,2,3] -> False
[1,2,2,1] -> False
[1,2,2,3] -> False
[1,2,1,2] -> True
[1,3,2] -> True
[3,1,2] -> True
[2,2,2] -> False

```

Answer: 
[Wolfram Language (Mathematica)](https://www.wolfram.com/wolframscript/), ~~37~~ 36 bytes
=========================================================================================

```
FreeQ[(d=Differences)@Sign@d@#,-2|2]&

```

Gives the opposite of the test case answers (False and True reversed). Prepend a `!` to switch to the normal form.

OR 

```
Abs@(d=Differences)@Sign@d@#~FreeQ~2&

```

Also reversed output, so replace `FreeQ` with `MatchQ` for normal form.

Explanation: Take the sign of the differences of the sequence. Iff the resulting sequence includes {1,-1} or {-1,1} there is a bump. The absolute value the differences of {1,-1} or {-1,1} is 2 in either case.

Shave off another byte by squaring the final list instead of taking the absolute value:

```
FreeQ[(d=Differences)@Sign@d@#^2,4]&

```

[Try it online!](https://tio.run/##y00syUjNTSzJTE78n2b7360oNTUwWiPF1iUzLS21KDUvObVY0yE4Mz3PIcVBWUfXqMYoVu1/QFFmXkl0mr5DdXWtTrUhCOsYQUgdKA/ON4bxETJwMZguYzBtDOUbgXXXxv4HAA "Wolfram Language (Mathematica) – Try It Online")
[Retina 0.8.2](https://github.com/m-ender/retina/wiki/The-Language/a950ad7d925ec9316e3e2fb2cf5d49fd15d23e3d), 43 bytes
======================================================================================================================

```
.+
$*
1`(1+)1¶\1¶1\1|¶(1+)(?<!\2¶\2)¶(?!\2)

```

[Try it online!](https://tio.run/##K0otycxL/P9fT5tLRYvLMEHDUFvT8NC2GCA2jDGsObQNJKBhb6MYYwQUNdIECtgD2Zr//xtyGXEZAgA "Retina 0.8.2 – Try It Online") Takes input on separate lines and outputs 0 or 1. Explanation:

```
.+
$*

```

Convert to unary.

```
1`            |

```

Count at most one matching regex.

```
  (1+)1¶\1¶1\1

```

Match a number that is surrounded by greater numbers on both sides.

```
               ¶(1+)(?<!\2¶\2)¶(?!\2)

```

Match a number that is not surrounded by greater or equal numbers on either side, i.e. both are less.