Given the head of a linked list where each node holds a single binary digit (0 or 1), the list represents a binary number with the most significant bit at the head. Return its decimal value.
Input: An array of binary digits (MSB first).
Output: Integer — the decimal value.
Input: [1,0,1]
Output: 5
Explanation: Binary 101 = 5.Input: [0]
Output: 0
Explanation: Zero.Input: [1,1,1,1]
Output: 15
Explanation: Binary 1111 = 15.1<=n<=30digit in {0,1}