You are given the head of a singly linked list, determine if the list is either strictly increasing or strictly decreasing.
An empty list or a list with a single node is considered to be both strictly increasing and strictly decreasing.
1 → 3 → 5 → 8 → null
True
The list is strictly increasing: 1 < 3 < 5 < 8.
10 → 7 → 4 → 1 → null
True
The list is strictly decreasing: 10 > 7 > 4 > 1.
1 → 3 → 3 → 5 → null
False
The list is not strictly increasing because 3 is not greater than 3.
1 → 5 → 2 → null
False
The list is neither strictly increasing nor strictly decreasing.
1 → 3 → 5 → 8 → null
True