In embedded systems, you may receive data as binary strings (e.g., "1101") via UART or user input, and need to convert it to an actual integer value — without using standard functions like strtol() or atoi().
Your task is to:
Example-1
Input: 1010
Output: 10
Example-2
Input: 0001
Output: 1
Example-3
Input: 11111111
Output: 255
Example-4
Input: 0
Output: 0
Input
1010
Expected Output
10