In embedded systems, you often receive hex strings from serial terminals or config files, like "1A3F", and need to convert them into integers — without using strtol(), sscanf(), or other library functions.
Your task is to:
Example-1
Input: 1A3F
Output: 6719
Example-2
Input: AF
Output: 175
Example-3
Input: 0000
Output: 0
Example-4
Input: ffff
Output: 65535
Input
1A3F
Expected Output
6719